Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Inputbox when cancelled

I must admit I thought there would be some way of catching
the click on the cancel button (vbCancel)...


There is; use this subroutine structure as a guideline...

Sub Test()
Dim strInput As String
strInput = InputBox("Some prompt for input")
If Len(strInput) = 0 Then
If StrPtr(strInput) = 0 Then
MsgBox "User clicked Cancel Button"
Else
MsgBox "No text entry, user clicked Enter"
End If
Else
MsgBox "The user inputted this text: " & strInput
End If
' The subroutine code continues here
End Sub

Rick
Reply
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 02:25 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"