Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Cancel InputBox

Hi

Look at this:

Sub aaa()
a = InputBox("Enter a value or text")
If a = "" Then MsgBox ("No entry, or Cancel")
If IsNumeric(a) Then
msg = MsgBox("Number")
Else
MsgBox ("Text")
End If
End Sub

Regards,
Per

"Alfredo_CPA" .(donotspam) skrev i meddelelsen
...
Hi,

Does anybody knows how to instruct VBA to diferentiate between a Cancel in
the InputBox and a cero entered in the impiut box? (excel 2003)
I have this code:
ElseIf myerrorvalue = False Then Exit Sub '(errorvalue is the result of
the
inputbox)

VBA is taking a 0 (cero) value as False (just like if the user click the
cancel button) and exits the sub, but I need the code to keep going

Thanks


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
InputBox Cancel event Rafi Excel Programming 2 February 9th 09 03:36 PM
InputBox Cancel event Rafi Excel Programming 1 February 9th 09 03:30 PM
InputBox Cancel Button A Mad Doberman Excel Programming 1 June 20th 08 09:49 PM
Doing nothing when pressing Cancel on InputBox Memento Excel Programming 4 December 3rd 07 12:58 PM
InputBox: Separate CANCEL and 0 Mike Excel Programming 3 July 20th 07 03:14 PM


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