Check whether a number is between two other numbers.
Warning: "range" has two meanings. This pattern is not about
You have a number that might be too small, or too high. You want to check it, to make sure it's OK.
Minimum, maximum, and a value to check.
A validated number, or an error.
- sMonth = InputBox("Birthday month (1-12)?")
- If sMonth >= 1 And sMonth <= 12 Then
- tMessage = "Thanks for the month"
- tMessage = "Sorry, " & sMonth & " isn't a valid month."
- End If
- MsgBox tMessage