I have the following code that copies a Master worksheet and renames it using Application.Inputbox.
'Generates input box to name the new Sheet and checks duplicate names
Set wks = ActiveSheet
Do While sName <> wks.Name
sName = Application.InputBox _
(Prompt:="Enter New Year")
On Error Resume Next
wks.Name = sName
On Error GoTo 0
Loop
Set wks = Nothing
This works fine except when the user clicks cancel. Current out comes are;
User inputs something and clicks 'ok' = master sheet copied and renamed to input value.
User inputs nothing and clicks 'ok' = Input box loops until value entered and 'ok' clicked or cancel clicked.
User clicks 'cancel' = master sheet copied and renamed to 'False'.
Desired Out come for user clicks 'cancel' = sub exited and nothing copied or altered.
Any help?