#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Input Box Cancel

I am using an input box, when i select the cancel button on my input box it
gives me a debug. Do I need to code this button to cancel? if so how?

thanks,

Jase
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Input Box Cancel

Try code something like this... it allows only numbers in the input box and
validates for numbers less than 1...

Sub test()
Dim var As Variant

var = Application.InputBox("please enter the number of sheets.", Type:=1)

If var < 1 Then
MsgBox "Won't print"
Else
MsgBox "Print " & var & " copies"
End If

End Sub
--
HTH...

Jim Thomlinson


"Jase" wrote:

I am using an input box, when i select the cancel button on my input box it
gives me a debug. Do I need to code this button to cancel? if so how?

thanks,

Jase

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Input Box Cancel

Num = InputBox("Enter a number ")
If Num = "" Or Not IsNumeric(Num) Then
MsgBox "you have cancelled or not entered a valid number"
End If


Gord Dibben MS Excel MVP

On Mon, 15 Sep 2008 11:54:01 -0700, Jase
wrote:

I am using an input box, when i select the cancel button on my input box it
gives me a debug. Do I need to code this button to cancel? if so how?

thanks,

Jase


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 Code Upon Cancel On Type 8 Input Box FARAZ QURESHI Excel Discussion (Misc queries) 2 March 31st 08 09:22 AM
Alerts - how to cancel TT Excel Discussion (Misc queries) 6 December 20th 06 06:15 PM
Input Box - CANCEL Danny Excel Worksheet Functions 6 December 1st 06 02:15 AM
Save - Yes / No / Cancel Jon Peltier Excel Discussion (Misc queries) 9 May 7th 06 02:03 AM
cancel input ME @ Home Excel Discussion (Misc queries) 1 February 22nd 06 09:49 AM


All times are GMT +1. The time now is 08:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"