lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
Why when I enter 66 as a number, this code print "Else"?
it does not go the first case? any idea why? I used F8 but again jump to the last case.
Thank you very much.
Why when I enter 66 as a number, this code print "Else"?
it does not go the first case? any idea why? I used F8 but again jump to the last case.
Thank you very much.
Code:
Sub test3()
Dim x As Integer
x = InputBox("enter number")
Select Case x
Case x > 50
MsgBox ">50"
Case x < 30
MsgBox "<30"
Case Else
MsgBox "else"
End Select
End Sub