Copy down formula macro

  • Thread starter Thread starter Eva
  • Start date Start date
E

Eva

Hi
I have this macro that doesn't work and I am not sure why:

LastRow = Sheets("Sheet1").Range("D" & Rows.Count).End(xlUp).Row
Sheets("Sheet1").Range("P2:q2").Copy _
Destination:=Sheets("Sheet1").Range("P3:Q" & LastRow)
Calculate

Macro should check how many rows are in column D and then copy the formula
form P2:Q2 down to the last row.
 
Certainly works for me.

What does it not do for you?

Add a message box after this line

LastRow = Sheets("Sheet1").Range("D" & Rows.Count).End(xlUp).Row

msgbox Lastrow

What number is returned?


Gord Dibben MS Excel MVP
 
Back
Top