LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA 2007 -- How can I tell if the user cancelled a Save? TomThumb Excel Programming 0 September 18th 07 01:30 PM
Hyperlink operation cancelled.... Kim Excel Discussion (Misc queries) 1 June 15th 07 03:24 PM
End Sub if InputBox cancelled (False) Francis Hookham Excel Programming 5 May 15th 07 03:39 PM
Avoid unloading of .xla addins when closing books are cancelled. Zoo Excel Programming 4 February 21st 06 03:58 PM
Email Sent or Cancelled mjamici Excel Programming 1 June 15th 05 06:46 PM


All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"