View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Copy down formula macro

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

On Wed, 9 Dec 2009 12:51:37 -0800, Eva
wrote:

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.