Copy and paste selected cells a given number of times

Closed
AndrasN - Jun 19, 2019 at 01:25 PM
 Blocked Profile - Jun 19, 2019 at 01:58 PM
Hello,

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

Selection.Copy

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

Sheets.Add After:=ActiveSheet
For j = 1 To i
Range("A1").Select
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,

A
Related:

1 response

Blocked Profile
Jun 19, 2019 at 01:58 PM
Offset by your loop counter 'j'.
0