#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Input Box

if you use application.inputbox, you can use the "type" parm.

numseries = application.inputbox(...., type:=1)

type:=1
means that the user has to enter a number (any old number) to be able to click
ok.

Andy wrote:

I figured out I needed to add Application

Dim numSeries as Integer
Do While numSeries < 1 Or numSeries 10
numSeries = Application.InputBox("How many series do you want to
graph? _
(Between 1 and 10)", "How Many", "1 to 10")
If numSeries = False Then Exit Sub
Loop

Is there a way to check if the input is in the wrong format?

"Andy" wrote:

I have VBA code as seen below and I want to get it to exit the sub if I
press the Cancel button, but I'm not quite sure how that works.


Dim numSeries as Variant
Do While numSeries < 1 Or numSeries 10
numSeries = InputBox("How many series do you want to graph? _
(Between 1 and 10)", "How Many", "1 to 10")
If numSeries = False Then Exit Sub
Loop


Thanks


--

Dave Peterson
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
How to input pictures automatically based on cell input? bsharp Excel Worksheet Functions 9 May 30th 09 07:16 AM
Have user input converted to uppercase in same cell as input? Shannonn New Users to Excel 1 June 20th 06 03:19 AM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 04:35 AM.

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"