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: 54
Default What type is vbCancel?

In the code fragment below, when I push the cancel button in response to the
inputbox, I get a type mismatch error. What type is vbCancel?

Dim myDate as String

Do
myDate = InputBox("Please enter your name.")
If myDate = vbCancel Then
Exit Sub
ElseIf myDate = "" Then
MsgBox ("You didn't enter anything. Please try again.")
End If
Loop While myDate = ""

In the same macro, I have these similar lines which work OK:

Dim myCheck as String

mycheck = MsgBox("Proceed?", vbYesNo)
If myCheck = vbNo Then
Exit Sub
End If

Why don't I get any type mismatch error with vbNo?


 
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
EXIT SUB UPON VBCANCEL FARAZ QURESHI Excel Discussion (Misc queries) 2 April 9th 09 12:38 PM
how to convert date type to text type Steffen Excel Discussion (Misc queries) 3 July 17th 07 11:32 AM
how to change all the words of one type(Gunsuh type)to another metumevlut Excel Discussion (Misc queries) 2 November 11th 05 03:29 PM
Adding new 'Type' to Format->Number->Time->Type Chip Pearson Excel Discussion (Misc queries) 5 September 26th 05 08:45 PM
vbCancel Robin Clay[_3_] Excel Programming 6 October 24th 03 12:03 PM


All times are GMT +1. The time now is 03:28 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"