Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. -- Greatly appreciated Eva |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
In what way doesn't it work because it looks fine to me? Mike "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. -- Greatly appreciated Eva |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
...Hm, I don't know what I did but it works now :) thanks
-- Greatly appreciated Eva "Mike H" wrote: Hi, In what way doesn't it work because it looks fine to me? Mike "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. -- Greatly appreciated Eva |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use Macro to Copy Formula from one Workbook to another | Excel Discussion (Misc queries) | |||
Do I use a formula or a macro to copy cells? | Excel Discussion (Misc queries) | |||
Formula/ Macro that will copy and paste | Excel Worksheet Functions | |||
Copy a formula down in a macro | Excel Discussion (Misc queries) | |||
Formula/Macro to copy into a cell | Excel Worksheet Functions |