#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Help with formula

Mike,

Could it be the unfortunate line break?

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


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Mike H" wrote in message
...
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"