SteveL13
asked on
Input box criteria
Is there a way to make a user enter a value greater than 0 in an input box? In other words, 1 or greater.
if you extend Rey's code it will accommodate strings, nulls etc.
Sub test1()
If Val(Nz(InputBox("Enter Value"), 0)) > 0 Then
MsgBox "Good value"
Else
MsgBox "Please enter a value greater than 0"
End If
End Sub
Sub test1()
If Val(Nz(InputBox("Enter Value"), 0)) > 0 Then
MsgBox "Good value"
Else
MsgBox "Please enter a value greater than 0"
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If InputBox("Enter Value") >= 1 Then
msgbox "Good value"
else
MsgBox "Please enter a value greater than 0"
End If