Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am having problems with an input box. The user can only put in a whole
number greater than or equal to 3. If they put in text or a decimal, I want it to display an error and reopen the dialogue box. I got the text part, but not the decimal validation. Any suggestions? The example of the code thus far is written below. 'The user is now asked to input the number of sides in the box. 'The only valid answers is a numeric whole number greater than or equal to 3 Dim c As Integer, sides As Variant c = 3 sides = Application.InputBox("Please enter the number of sides of your box", "Box Geometry", c) If sides = False Then GoTo 100 If sides = "" Or Not IsNumeric(sides) Then GoTo 2 Else GoTo 3 2 Repsonse = MsgBox("Your input must be a whole number greater than 3. Try again.", vbOKOnly, "Error") GoTo 1 3 If sides < 3 Then GoTo 2 Else GoTo 4 4 100 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is input validation? | Excel Discussion (Misc queries) | |||
Validation Input Text | Excel Discussion (Misc queries) | |||
input in number form is being multiplied by 1000 when i input. | Excel Discussion (Misc queries) | |||
input masks and validation | Excel Discussion (Misc queries) | |||
Help with VBA Input Validation | Excel Programming |