Input Box Q
Hi
Something like
Sub test01()
uservalue = InputBox("Value to use? Between 0% and 99%")
uservalue2 = Format(uservalue, "#.00")
If uservalue2 < 0 Or uservalue2 99 Then
MsgBox "Value outside range of 0% to 99%"
Exit Sub
End If
If uservalue2 1 Then
uservalue = Format(uservalue2 / 100, "#%")
Else
uservalue = Format(uservalue2, "#%")
End If
Range("B3").Value = uservalue
End Sub
--
Regards
Roger Govier
"Seanie" wrote in message
...
I have a very simple Input Box as below, which asks a user to enter a
value. How can I build in validations within it that will check to
ensure that the value entered is a percentage, between 0% and 99%.
Also can I trap that the user must enter something and is not allowed
just to cancel out of it? My input box below has a OK/Cancel button
Sub test01()
UserValue = InputBox("Value to use?")
Range("B3").Value = UserValue
End Sub
|