throwawayaccount
New Member
- Joined
- Apr 28, 2017
- Messages
- 7
Getting this error and after research cannot find a solution. Consistently, this macro works fine until the third time I run it, regardless of the name I give the sheets. It always bombs out despite the "on error goto nextb" giving me the following error:
Microsoft Visual Basic
Run-time error '1004':
Cannot rename a sheet to the same name as another sheet, a referenced object library or a workbook referenced by Visual Basic.
This is the only workbook I have open, there are only two other sheets (none hidden, very-hidden, etc.). Can anyone help?
Microsoft Visual Basic
Run-time error '1004':
Cannot rename a sheet to the same name as another sheet, a referenced object library or a workbook referenced by Visual Basic.
This is the only workbook I have open, there are only two other sheets (none hidden, very-hidden, etc.). Can anyone help?
Code:
Sheets.Add After:=Sheets(Sheets.Count)
For b = 1 To 100
On Error GoTo nextb
ActiveSheet.Name = "New Output " & b
GoTo skip
nextb:
Next b
skip: