Macro to copy last row of data into multiple rows below

Andrew B

New Member
Joined
Jan 21, 2011
Messages
27
[FONT=&quot]Hi All!
I have a macro that copies the last row of data on Sheet1 into the row below it:

[/FONT]
Code:
  [FONT=&quot]Sub CopyRow()[/FONT]
  
  [FONT=&quot]Dim LR As Long[/FONT]
  
  [FONT=&quot]With Sheets("Sheet1")[/FONT]
  [FONT=&quot]    LR = .Range("A" & Rows.Count).End(xlUp).Row[/FONT]
  
  [FONT=&quot]    .Rows(LR).Copy Destination:=Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)[/FONT]
  
  [FONT=&quot] End With[/FONT]
  [FONT=&quot]End Sub[/FONT]
[FONT=&quot]

I need it to copy that data into the 10 rows below it. I know that copying the expression

Code:
.Rows(LR).Copy Destination:=Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)
ten times will work (I've tried it), but surely there is a more elegant way of scripting the command. Can anyone help me? I'm clueless :confused:
Thanks,
Andrew B[/FONT]
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try re-sizing the destination to 10 rows.

Code:
.Rows(LR).Copy Destination:=Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1)[COLOR="Red"].Resize(10)[/COLOR]
 
Upvote 0
AlphaFrog,

Thank you very much for your speedy and helpful reply. It works great!!!

Sincerely,
Andrew
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top