I am using a VBA code doing the value input directly in the code, but it is really slow when values has to be changed as you can imagine.
How can I modify this code so I can use input in a user form for some of the values? This is the code, it copies a range, and past it n times in a different sheet. What I am looking for is to select the range in a inputbox, then enter how many times the range should be pasted into either the same sheet, or in a different sheet.
Sub CopyPaste()
Application.ScreenUpdating = False
i& = Sheet1.Cells(Rows.Count, 5).End(xlUp).Row
k& = 2
For j& = 1 To 26
Sheet1.Range("A1:B3" & i).Copy
Sheet2.Range("E" & k).PasteSpecial
Application.CutCopyMode = False
k = k + 1
Next
Application.ScreenUpdating = True
End Sub
How can I modify this code so I can use input in a user form for some of the values? This is the code, it copies a range, and past it n times in a different sheet. What I am looking for is to select the range in a inputbox, then enter how many times the range should be pasted into either the same sheet, or in a different sheet.
Sub CopyPaste()
Application.ScreenUpdating = False
i& = Sheet1.Cells(Rows.Count, 5).End(xlUp).Row
k& = 2
For j& = 1 To 26
Sheet1.Range("A1:B3" & i).Copy
Sheet2.Range("E" & k).PasteSpecial
Application.CutCopyMode = False
k = k + 1
Next
Application.ScreenUpdating = True
End Sub