Macro to Copy and paste in interval of 7 rows

amitcohen

Board Regular
Joined
Jan 14, 2010
Messages
118
Hi All
Hope you can help me..

I need to copy a range of cells (A3:J43)
and then to paste it 7 rows under the previous paste.
This need to take place 100 times.

In other words:
Copy 40 rows
Jump 7 rows (from the last cell of the range)
paste the 40 rows
jump 7 rows (from the last cell of the range)
paste 40 row

and so on.. 100 times.

Thank you for your kind help.

Amit
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi
Assuming you want to paste the same range 100 times, try the following codes
Code:
Sub copyNpaste()
Dim a As Long
Application.ScreenUpdating = False
Sheets("sheet1").Range("A3:J43").Copy
    For a = 1 To 100
    Sheets("Sheet2").Range("A" & (a - 1) * 47 + 1).PasteSpecial
    Next a
Application.ScreenUpdating = True
MsgBox "Copying complete"
end sub
Ravi
 
Upvote 0
Assuming the 6 rows below your copy range are blank, this would be a lot quicker.
Do we need to worry about PasteSpecial?

If you want the original plus 100 copies (that is 101 versions in total) then change the 100 in the code to 101.

<font face=Courier New><br><SPAN style="color:#00007F">Sub</SPAN> Copy_Paste()<br>    <SPAN style="color:#00007F">With</SPAN> Range("A3:J43")<br>        .Resize(.Rows.Count + 6).Copy Destination:=.Resize(100 * (.Rows.Count + 6))<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
Hi Peter
This is truly amazing!!
Its 100% accurate.
You guys saved me a lot of time. ;)

Many thanks

Amit Cohen
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,207
Members
449,214
Latest member
mr_ordinaryboy

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