jkwleisemann
New Member
- Joined
- May 31, 2016
- Messages
- 19
I'm trying to set the name of a worksheet using the following code, and it's failing to process for some reason. Can anybody help me out with this?
Also, if there's any way for me to try and set the name when I'm doing the Copy method, that'd be great. I'd like to try and minimize the number of chances to throw "errors" that aren't.
Code:
Sub CreateNew()
intTabs = Worksheets(1).Cells(18, 2).Value
For i = 1 To intTabs
strWsName = InputBox("Please name Sheet" & i & ".", "Sheet" & i & " Name", "Sheet" & i)
If i > 1 Then Worksheets(5).Copy After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = strWsName
Next
End Sub
Also, if there's any way for me to try and set the name when I'm doing the Copy method, that'd be great. I'd like to try and minimize the number of chances to throw "errors" that aren't.