LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default vbCancel

You're right.

I was using the InputBox method (Application.InputBox) rather than
the InputBox function. I should have read the OP's question and your
response in a less cursory manner.

Paul
-----------------------------------------------------------------------

On Thu, 23 Oct 2003 15:09:17 -0400, "Tom Ogilvy"
wrote:

But he was making his comparison to vbCancel which is a two and is usable
with a msgbox, not an input box.

? vbCancel
2


You said hitting cancel in an inputbox returns zero - it doesn't

"When I hit Cancel (or X) on an InputBox, I get the returned value of 0

(Zero)."

Tested in the immediate window (cancel was selected)

? inputbox("abc")

------ it returned a null string

? typename(inputbox("abc"))
String

A vba inputbox always returns a string.

An empty string is coerced to zero in most cases if you force it to be used
as a number, but not always. For instance

? inputbox("abc") = 0
raises a type mismatch error when I hit cancel.

I just provided information on what an inputbox actually returns.


 
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


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