Djblois
09-19-2006, 03:39 AM
I have users input the name for a new sheet but sometimes they give it the same name as a sheet already in the file, so I created this code but it doesn't seem to work.
For nameTest = 1 To Worksheets.Count
On Error Resume Next
If Worksheets(nameTest).Name = (myInput) Then
MsgBox "You can not give two reports the same name. Please choose another name!"
PivotTableOptions.Show
End
End If
Next
For nameTest = 1 To Worksheets.Count
On Error Resume Next
If Worksheets(nameTest).Name = (myInput) Then
MsgBox "You can not give two reports the same name. Please choose another name!"
PivotTableOptions.Show
End
End If
Next