Macro to Paste Selection Every 12 Rows

garygraham

New Member
Joined
Jun 28, 2011
Messages
13
I'm new to macros but trying to learn. Thanks in advance for your help.

I'm trying to copy a range of cells A3:G3 (with formulas) and then paste it every 12 rows to the end of the data which is row 67,789. In other words the range A3:G3 would be pasted into A15, A27, A39, A51, etc. all the way to A67,789.

Thanks,
Gary
 
It's late here so I must sign off now. I'll check back tomorrow to see how it went.
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Trebor 76,

Actually the range should be A3:G13 which contains the formulas which when pasted into the sections every 12 rows below will copy the data in the row above above each section respectively. i.e. The formulas from A3:G13 should be copied into A15:G25, A27:G37, A39:G49... all the way to the end of the sheet at A67587:G67597.

Thanks for your help.
Gary
 
Upvote 0
Trebor76,

This is what finally worked. Thanks for all your help.

Sub CopyPasteMacro()
' Copy A3:G13 and paste every 12 rows thereafter starting at row 15

Dim lngLastRow As Long, _
lngPasteRow As Long

lngLastRow = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

Application.ScreenUpdating = False

For lngPasteRow = 15 To lngLastRow Step 12
If lngPasteRow > 2 Then
Range("A3:G13").Copy Destination:=Range("A" & lngPasteRow & ":G" & lngPasteRow)
End If
Next lngPasteRow

Application.ScreenUpdating = True

End Sub


Thanks,
Gary
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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