Lee has attended:
Excel VBA Intro Intermediate course
Copying data
What is the code for copying data from a cell down to the point where the data in the cell to the left stops.
I have data in cells C12 to C50 I need to write a code to copy the formula i have in cell D12 to D50
The number of rows that has the data will change every time i run the macro so i need to copy the data down as far as required.(i.e not down to row 50 every time)
Thanks
Lee
RE: Copying data
Hi Lee
Thanks for the question
I would create an uinteger variable and set it equal to the rows count of the current region of the first cell in the column.
introws = range("A1").currentregion.rows.count
you could then use a For loop to start at row one and go to the final row as determined above. At each point in the loop you could write in the formula
Regards
Stephen