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: 8
Default Inputbox and cancel button

Hi All,

I am rather confused as to why the following macro does not work properly. The
problem is when the user presses the cancel button without entering anything in
the Inputbox it starts looping! However, if the user presses OK without
entering anything in the Inputbox then it exits! Can you see why. Thanks for
your help.

Dim UInput as string
Dim Msg as string
Msg = "Enter todays date"

Do
UInput = Application.inputbox(Msg)
If UInput = "" then Exit Sub
If Isdate(UInput) then
Msgbox "Thank You"
Exit Do
End if
Msg = "You did not enter a date"
Msg = Msg & vbNewLine
Msg = Msg & "Enter todays date"
Loop

Regards
UJ
 
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
Detecting Cancel in an InputBox Method Connie Excel Discussion (Misc queries) 2 October 19th 06 01:32 PM
Cancel button in Inputbox method MiRa Excel Programming 2 November 14th 03 01:04 PM
Inputbox method using type:=8 - How to Cancel? Joe 90 Excel Programming 0 July 10th 03 12:24 AM
Inputbox method using type:=8 - How to Cancel? Harlan Grove[_5_] Excel Programming 1 July 9th 03 12:06 AM
Inputbox method using type:=8 - How to Cancel? Jim Cone Excel Programming 0 July 8th 03 06:15 PM


All times are GMT +1. The time now is 05:50 PM.

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"