View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sandy Sandy is offline
external usenet poster
 
Posts: 270
Default Inputbox when cancelled

I have the following

Sub NewName()
ActiveWorkbook.Unprotect

Sheets("Current Round").Unprotect Password:="*******"

Application.ScreenUpdating = False
Application.EnableEvents = False

Dim inputText As String
Dim newFileName As String

inputText = Application.InputBox("Enter name here", _
"Person's Name", , , , , 2)

*******More Code********

End Sub

What I would like is that if the inputbox cancel button is clicked then

ActiveWorkbook.Protect
Sheets("Current Round").Protect Password:="*******"

Application.ScreenUpdating = True
Application.EnableEvents = True

Exit Sub

otherwise run the ********More Code*******

How do I incorporate that into the Sub?

Thanks
Sandy