![]() |
Help with formula
Hi, i need your help with the following;
I'm attempting to copy row A11:Y11 to A12:Y by the number of columns in Data1 Row "A" Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Worksheets("Calculations").Range("A11:Y11").Copy Worksheets("Calculations").Range("A12" & Lastrow). Paste:=xlNormal Therby it should copy cells a11:Y11 to A12:Y59 if Lastrow were to = 47 (if I've got that right) How have I cocked up with this formula?? Regards Lee |
Help with formula
Try,
Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Sheets("Calculations").Range("A11:Y11").Copy Sheets("Calculations").Range("A12:A" & Lastrow + 12).PasteSpecial Mike "leerem" wrote: Hi, i need your help with the following; I'm attempting to copy row A11:Y11 to A12:Y by the number of columns in Data1 Row "A" Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Worksheets("Calculations").Range("A11:Y11").Copy Worksheets("Calculations").Range("A12" & Lastrow). Paste:=xlNormal Therby it should copy cells a11:Y11 to A12:Y59 if Lastrow were to = 47 (if I've got that right) How have I cocked up with this formula?? Regards Lee |
Help with formula
Hi Mike;
The cells copied over but than halted with an error msg of 'PasteSpecial method of Range Class failed' Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Sheets("Calculations").Range("A11:Y11").Copy Sheets("Calculations").Range("A12:A" & Lastrow + 10).PasteSpecial Paste:=xlNormal, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False any ideas "Mike H" wrote: Try, Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Sheets("Calculations").Range("A11:Y11").Copy Sheets("Calculations").Range("A12:A" & Lastrow + 12).PasteSpecial Mike "leerem" wrote: Hi, i need your help with the following; I'm attempting to copy row A11:Y11 to A12:Y by the number of columns in Data1 Row "A" Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Worksheets("Calculations").Range("A11:Y11").Copy Worksheets("Calculations").Range("A12" & Lastrow). Paste:=xlNormal Therby it should copy cells a11:Y11 to A12:Y59 if Lastrow were to = 47 (if I've got that right) How have I cocked up with this formula?? Regards Lee |
Help with formula
Hi,
I'm afraid i can't replicate that error, the code I gave you and your modified version work fine for me. Mike "leerem" wrote: Hi Mike; The cells copied over but than halted with an error msg of 'PasteSpecial method of Range Class failed' Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Sheets("Calculations").Range("A11:Y11").Copy Sheets("Calculations").Range("A12:A" & Lastrow + 10).PasteSpecial Paste:=xlNormal, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False any ideas "Mike H" wrote: Try, Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Sheets("Calculations").Range("A11:Y11").Copy Sheets("Calculations").Range("A12:A" & Lastrow + 12).PasteSpecial Mike "leerem" wrote: Hi, i need your help with the following; I'm attempting to copy row A11:Y11 to A12:Y by the number of columns in Data1 Row "A" Lastrow = Worksheets("Data1").Cells(Rows.Count, "A").End(xlUp).Row Worksheets("Calculations").Range("A11:Y11").Copy Worksheets("Calculations").Range("A12" & Lastrow). Paste:=xlNormal Therby it should copy cells a11:Y11 to A12:Y59 if Lastrow were to = 47 (if I've got that right) How have I cocked up with this formula?? Regards Lee |
All times are GMT +1. The time now is 01:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com