P
Paul Black
Hi Everybody,
I would like VBA Code that is Similar to the One Below ( but Not
Adapting the One Below, I Still want to Use it as it is ) which Works a
Treat ...
Code:
Sub SheetInsert()
Dim s1 As String, s2 As String
Dim x As Long, y As Long, i As Long
Dim pasteto As String
Application.ScreenUpdating = False
s1 = "How many sheets would you like to add?"
s2 = "What would you like the number of the first sheet to be?"
x = InputBox(s1)
y = InputBox(s2, "Insert Sheets")
For i = 1 To x
Sheets.Add After:=Sheets(Sheets.Count)
pasteto = i + y - 1
ActiveSheet.Name = pasteto
With Sheets(pasteto)
Sheets("Master").Cells.Copy _
Destination:=.Range("A1")
.Range("A1").Value = .Name
.Range("B22").Select
End With
Next i
Application.ScreenUpdating = True
End Sub
.... to Ask me in the First Box which Sheet to Start with, and the
Second Box to Ask me which Sheet to End with ( the Sheets are Numbered
1 to Whatever for Example ).
I then want Each of those Sheets to be Highlighted in the Top Left Hand
Corner so it Selects ALL of the Sheet, and for ALL of the Sheets
Specified. I then want to Copy and Paste Special Using Values.
And Finally, I would like the Cursor to End Up in Cell B22 of EVERY
Sheet Please.
Thanks in Advance.
All the Best.
Paul
I would like VBA Code that is Similar to the One Below ( but Not
Adapting the One Below, I Still want to Use it as it is ) which Works a
Treat ...
Code:
Sub SheetInsert()
Dim s1 As String, s2 As String
Dim x As Long, y As Long, i As Long
Dim pasteto As String
Application.ScreenUpdating = False
s1 = "How many sheets would you like to add?"
s2 = "What would you like the number of the first sheet to be?"
x = InputBox(s1)
y = InputBox(s2, "Insert Sheets")
For i = 1 To x
Sheets.Add After:=Sheets(Sheets.Count)
pasteto = i + y - 1
ActiveSheet.Name = pasteto
With Sheets(pasteto)
Sheets("Master").Cells.Copy _
Destination:=.Range("A1")
.Range("A1").Value = .Name
.Range("B22").Select
End With
Next i
Application.ScreenUpdating = True
End Sub
.... to Ask me in the First Box which Sheet to Start with, and the
Second Box to Ask me which Sheet to End with ( the Sheets are Numbered
1 to Whatever for Example ).
I then want Each of those Sheets to be Highlighted in the Top Left Hand
Corner so it Selects ALL of the Sheet, and for ALL of the Sheets
Specified. I then want to Copy and Paste Special Using Values.
And Finally, I would like the Cursor to End Up in Cell B22 of EVERY
Sheet Please.
Thanks in Advance.
All the Best.
Paul