Copy and paste selected cells a given number of times [Closed]

 Blocked Profile -

I had a quick course on macro and I would like to write my first one, but I would need some help with it.

Id like a macro which copies the selected cells to a new worksheet. Id like it to copy under each other as many times, as the user gives in a msgbox.

So far I am at this stage, but cant figure out how to copy them under each other:

Sub Copy_Paste()
' Copy_Paste Macro
Dim i As Integer
Dim j As Integer


i = InputBox("Enter number copies to insert", "Paste")

Sheets.Add After:=ActiveSheet
For j = 1 To i
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(1, 0).Select
Next j

Last: Exit Sub

End Sub

Thanks a lot for the help in advance,


1 reply

Offset by your loop counter 'j'.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!