Hopefully somebody can help a bit here I have some code which copies the first sheet and inserts the required number of copies into the workbook.
This works great but what I would like to achieve is this
The first sheet Row 17 columns P-T are numbered 1,2,3,4,5. and I would like to each of these cells to increment for each sheet as it is copied.
Example
Sheet 1 Row 17 columns P-T numbered 1,2,3,4,5
Sheet 2 Row 17 columns P-T numbered 6,7,8,9,10
Etc for the number of sheets you require. I’m not sure if this is possible as I am having trouble finding any information to give me a start.
Any help is always appreciated
Code below
This works great but what I would like to achieve is this
The first sheet Row 17 columns P-T are numbered 1,2,3,4,5. and I would like to each of these cells to increment for each sheet as it is copied.
Example
Sheet 1 Row 17 columns P-T numbered 1,2,3,4,5
Sheet 2 Row 17 columns P-T numbered 6,7,8,9,10
Etc for the number of sheets you require. I’m not sure if this is possible as I am having trouble finding any information to give me a start.
Any help is always appreciated
Code below
VBA Code:
Sub CreateSheets()
'this will enter the number of sheets required from input box and rename them
Dim I As Long
Dim xNumber As Integer
Dim xName As String
Dim xActiveSheet As Worksheet
On Error Resume Next
Application.ScreenUpdating = False
Set xActiveSheet = ActiveSheet
xNumber = InputBox("Enter Number of Sheets Required")
For I = 2 To xNumber
xName = ActiveSheet.Name
xActiveSheet.Copy After:=ActiveWorkbook.Sheets(xName)
ActiveSheet.Name = "Page " & I
Next
xActiveSheet.Activate
Application.ScreenUpdating = True
End Sub