Article ID: 150374
Article Last Modified on 10/10/2006
Sub EvenOrOdd()
'Enter loop
For Counter = 1 To 5
'Use the IsEven function to determine whether or not the number
'being tested is even: a return value of False means the number
'is odd. You could alternatively use the IsOdd function.
ValueIsEven = IsEven(Counter)
'If ValueIsEven is true, then...
If ValueIsEven = True Then
'...display a message box stating so.
MsgBox "The value " & Counter & " is even."
'Otherwise...
Else
'...display a message box stating that the value is odd.
MsgBox "The value " & Counter & " is odd."
End If
Next Counter
End Sub
iseven
Additional query words: 97 8.00 98 XL98 XL97 XL7 XL5 XL
Keywords: kbcode kbdtacode kbprogramming KB150374