WCAconsulting
New Member
- Joined
- Mar 31, 2018
- Messages
- 9
First time posting here, but have found many answers to questions by searching before. Hoping someone might have an answer on how to do the following:
1. I have a locked sheet that has very limited abilities to format anything due to a macro that allows uploading to a specific database.
2. Need to copy one sheet "x" number of times
3. Need to rename the "x" number of copied sheets in sequential order without renaming some others
4. Need to insert the sequential number "x" into a cell located in the sheet I am copying.
I have found these two macros that work. The Copy Sheets one works flawlessly and does not effect uploading.
The Renaming Sheets one works great, but changes the name of a reference tab the uploading macro is looking for. Is there anyway for it to only rename the copied sheets?
Sub Copysheet()
Dim i As Integer
Dim p As Integer
On Error GoTo out
i = InputBox("How many copies do you what?", "Making Copies")
Application.ScreenUpdating = False
p = 0
Do
ActiveSheet.Copy After:=Sheets(Sheets.Count)
p = p + 1
Loop Until p = i
Application.ScreenUpdating = True
Exit Sub
out:
MsgBox "copy was cancelled"
Application.ScreenUpdating = True
End Sub
Sub RenamingSheets()
nmbr = InputBox("What's the first number you want to name the sheets?", "Renaming Sheets")
For ws = 1 To Worksheets.Count
Sheets(ws).Name = "Stim Rpt Stage" & nmbr
nmbr = nmbr + 1
Next ws
End Sub
1. I have a locked sheet that has very limited abilities to format anything due to a macro that allows uploading to a specific database.
2. Need to copy one sheet "x" number of times
3. Need to rename the "x" number of copied sheets in sequential order without renaming some others
4. Need to insert the sequential number "x" into a cell located in the sheet I am copying.
I have found these two macros that work. The Copy Sheets one works flawlessly and does not effect uploading.
The Renaming Sheets one works great, but changes the name of a reference tab the uploading macro is looking for. Is there anyway for it to only rename the copied sheets?
Sub Copysheet()
Dim i As Integer
Dim p As Integer
On Error GoTo out
i = InputBox("How many copies do you what?", "Making Copies")
Application.ScreenUpdating = False
p = 0
Do
ActiveSheet.Copy After:=Sheets(Sheets.Count)
p = p + 1
Loop Until p = i
Application.ScreenUpdating = True
Exit Sub
out:
MsgBox "copy was cancelled"
Application.ScreenUpdating = True
End Sub
Sub RenamingSheets()
nmbr = InputBox("What's the first number you want to name the sheets?", "Renaming Sheets")
For ws = 1 To Worksheets.Count
Sheets(ws).Name = "Stim Rpt Stage" & nmbr
nmbr = nmbr + 1
Next ws
End Sub