even
You can also do it this way (execution should be marginally faster)...
MyVariable = 9
If MyVariable And 1 Then
MsgBox "Odd"
Else
MsgBox "Even"
End If
Rick
"Mike H" wrote in message
...
Use the MOD function
myvariable = 9
If (myvariable Mod 2) 0 Then
MsgBox "Odd"
Else
MsgBox "Even"
End If
Mike
"ranswert" wrote:
How do I find out if a variable is even?
Thanks
|