ocvmelbye
11-08-2016, 01:02 AM
Hi,
I need some help making a vba code to do the following on the attached file:
When clicking the button ("Print merkostnader" on the "Utregning merkostnader" sheet) I want the following to happen:
If there is text in cell C24 in "Utregning merkostnader" sheet, copy text from cell B24, C24, H24, O24, U24 and W24.
And then check if there is text in C25 and then do the same.
Then when the loop find a cell in the C row from C24 that dont contain any text, stop the loop.
Then I want the content that is copyed to be pasted in the sheet called "Print merkostnader"
B24 paste to A9
C24 paste to B9
H24 paste to F9
O24 paste to G9
U24 paste to H9
W24 paste to I9
So after this loop is done
Copy the text from "Utregning merkostnader" B7, C7, D7 - ONLY if the cell C7 is not 0. Then do it in the range B7: D18.
Go to sheet "Print merkostnader"
Lineshift
In next available row make following headers:
In row B: Opprull
In row F: Antall meter
In row I: Total pris
Lineshift
Then paste it like this in "Print merkostnader"
B7 paste to next available B row
C7 paste to next available F row
D7 paste to next available I row
So after this loop is done
I want two line shifts and a line to sign it.
Like this:
________________________________
Place/date Signature
Thank you!
I need some help making a vba code to do the following on the attached file:
When clicking the button ("Print merkostnader" on the "Utregning merkostnader" sheet) I want the following to happen:
If there is text in cell C24 in "Utregning merkostnader" sheet, copy text from cell B24, C24, H24, O24, U24 and W24.
And then check if there is text in C25 and then do the same.
Then when the loop find a cell in the C row from C24 that dont contain any text, stop the loop.
Then I want the content that is copyed to be pasted in the sheet called "Print merkostnader"
B24 paste to A9
C24 paste to B9
H24 paste to F9
O24 paste to G9
U24 paste to H9
W24 paste to I9
So after this loop is done
Copy the text from "Utregning merkostnader" B7, C7, D7 - ONLY if the cell C7 is not 0. Then do it in the range B7: D18.
Go to sheet "Print merkostnader"
Lineshift
In next available row make following headers:
In row B: Opprull
In row F: Antall meter
In row I: Total pris
Lineshift
Then paste it like this in "Print merkostnader"
B7 paste to next available B row
C7 paste to next available F row
D7 paste to next available I row
So after this loop is done
I want two line shifts and a line to sign it.
Like this:
________________________________
Place/date Signature
Thank you!