I am currently creating a new sheet and having the user name it with a unique sheet name. I have a loop that checks once and prompts the user to enter a new sheet name if it is wrong the first time, but I don't know how to restart the loop once this happens.
Dim myValue As Variant
myValue = InputBox("Enter New Sheet Name")
Dim exists As Boolean
exists = True
While exists = True
For i = 1 To Worksheets.Count
If Worksheets(i).Name = myValue Then
exists = True
myValue = InputBox("You entered an existing sheet name. Please enter a unique sheet name")
Else
exists = False
End If
Next i
i = 1
Wend
Sheets("NewSheet").Name = myValue
End Sub
Thank you!
