Useful little function in case anyone was wondering on how to determine if a number is even or odd. I must be bored...VB Code:
Private Function IsEven(lNum As Long) As Boolean IsEven = Not CBool(lNum& And 1) End Function
Printable View
Useful little function in case anyone was wondering on how to determine if a number is even or odd. I must be bored...VB Code:
Private Function IsEven(lNum As Long) As Boolean IsEven = Not CBool(lNum& And 1) End Function
Another way
Code:If Number mod 2 = 0 then 'number is even Else 'number is odd