find last row in one column and copy + paste data to same row in a

G

Guest

I'm attempting to do the following in an excel macro:
Step 1: - find last row containing data in column X
Step 2: - copy the formula from cell Y1 through every cell down to Y* where
* represents the row number found in step 1

Can anybody help? Thanks.
 
G

Gord Dibben

Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("X" & Rows.Count).End(xlUp).Row
Range("Y1:Y" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP
 
G

Guest

That did it -- many thanks.

Gord Dibben said:
Sub Auto_Fill()
Dim Lrow As Long
With ActiveSheet
Lrow = Range("X" & Rows.Count).End(xlUp).Row
Range("Y1:Y" & Lrow).FillDown
End With
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top