Sub GetValue3()
MinVal = 1
MaxVal = 12
Msg = "Enter a value between 1 and 12"
ValidEntry = False
Do
UserEntry = InputBox(Msg)
If IsNumeric(UserEntry) Then
If UserEntry >= 1 And UserEntry <= 12 Then
ValidEntry = True
Else
Msg = "Your previous entry was INVALID. Enter a value between 1 and 12"
End If
End If
If UserEntry = "" Then Exit Sub
Loop Until ValidEntry
ActiveSheet.Range("A1").Value = Val(UserEntry)
End Sub
|