Excel Custom Function with Select Case
Phobos,
Thank you for elaborating on J.E. McGimsey's comments. That subroutine is
interesting for it demonstrates that all values except 0 are evaluated as
true. And looking at J.E. McGimpsey's earlier comments, true "...coerces
the boolean True to -1..."
Okay, that is great to know! Again, thank you very much.
Regards,
Kevin
"Phobos" wrote in message
...
Just to clarify:
In VBA, True = -1 False = 0
But, also in VBA:
0 = False <any other value = True
Try this code:
Sub test()
Dim isFalse As Boolean
Dim x As Integer
For x = -20 To 20
isFalse = x
Debug.Print x & " " & isFalse
Next
End Sub
You will see in the immediate window after execution that all values
except
0 return True.
P
|