Even and Odd

G

Guest

IS there a keyword in Visual Basic that recognizes whether a number is odd or
even.
 
N

Niek Otten

If you have Analysis Toolpak loaded and set a reference to it in VBA, then
ISODD() and ISEVEN() are available
 
B

Bernard Liengme

You could 'roll your own'

Function test(num) As Boolean
test = (num Mod 2 = 0)
End Function
 
G

Guest

Could you explain a little more on how to call these functions and an exampl
of code for them. How t oset a reference? Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top