lastknownuser
New Member
- Joined
- Feb 1, 2022
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Started very recently with VBA so I'm not an expert but I am familiar with programming in other languages.
I want to create a macro to write a number of names and it would create list (by copying template on the side), and the problem is after row 50, 100,... How can I define that on new page it starts at 51 as first row? I attached the pictures. So the problem is splitting of copied range as can be seen in picture, I don't want that
Any help would be welcome, especially if there are more examples of this kind of template creating for print, thank you
Current short code:
I want to create a macro to write a number of names and it would create list (by copying template on the side), and the problem is after row 50, 100,... How can I define that on new page it starts at 51 as first row? I attached the pictures. So the problem is splitting of copied range as can be seen in picture, I don't want that
Any help would be welcome, especially if there are more examples of this kind of template creating for print, thank you
Current short code:
VBA Code:
Sub test()
Range("J1:R5").Select
Selection.Copy
Dim ink As Integer
Dim i As Integer
i = 1
ink = InputBox("Enter number of names")
ink2 = ink * 6
For i = 1 To ink2 Step 6
Worksheets("sheet1").Cells(i, 1).Select
ActiveSheet.Paste
Next i
End Sub