#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default vbCancel

Probably, but an inputbox will return a string. Text. "1", "5", or similar. If Ans is
declared as a String then the thing is not a number. If it's Long or Double then VBA may
convert it by helpful intelligence -but it will crash merciless if you enter "Dont know"
into the box. Anyway, Cancel returns "" no matter what you prompt for desired entries.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

wrote in message
...
Maybe, I'm missing something. I thought that he was trying to return a
number between 1 and 5.

Paul

----------------------------------------------------------------------------------------

--------------

According to help:

If the user clicks OK or presses ENTER , the InputBox function returns
whatever is in the text box. If the user clicks Cancel, the function returns
a zero-length string ("").

you must have Ans dim'd as a number.




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
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 03:59 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"