I made a simple vba application that allows a user to enter data into excel. The data that's being entered had to be >= 1.99 ohms and can be 3.00 or higher. Everything works great and it's been in use for over a year now. However, recently a user fat fingered a decimal point and didn't catch it until they entered the number. VBA didn't like that and errored out. The format they entered looked like so: '.2.34'. I can't seem to figure out how to avoid this. Any suggestions?
I've tried using:
If Res.value <> Format(Number, "#.##") Then
Msgbox ("blah blah")
Res.Value = ""
Exit Sub
End if
This blocks those entries, but it also blocks correct entries.
IsNumeric(Res.Value)
to check if it is a number and if it is a number you can check afterwardsIf Res.Value => 1.99 And Res.Value < 3.00
or something similar.