Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Case Is >= 0.5, Is < 5
I'm not sure that I agree, I'd say that the CASE is evaluated as TRUE if the condition in the CASE statement is met. In the case of the post by strongm, the condition is met (therefore the case is evaluated as TRUE) if the value of MyValue is any number.Gerry said:Except.....the OP is not using an IF (which returns a True/False). The OP is using Select Case which functions as an numeric evaluation of MyValue if MyValue is numeric.
Dim MyValue As Long
MyValue = 113
Select Case MyValue
Case True
Debug.Print "yes it is true"
Case False
Debug.Print "no, no bananas"
Case Else
Debug.Print "whatever"
End Select
Case True
Dim MyValue As Long
MyValue = 113
Select Case MyValue
Case 113
' VBA mumbles to itself...[b]True[/b], so...
' do the following actions