Thread: even numbers
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tommi[_2_] Tommi[_2_] is offline
external usenet poster
 
Posts: 20
Default even numbers

I tried this. I set the Tools/Referencese to atpvbaen.xls and then used
IsEven. but I get this "Run-Time Error '1004' The macro " cannot be found"
What is wrong?

"Dana DeLouis" wrote in message
...
Just another option. If you have a vba library reference set to
atpvbaen.xls, then you can use IsOdd / IsEven directly.

Sub Demo()
Debug.Print IsOdd(12345678901234)
Debug.Print IsEven(12345678901234)

Debug.Print IsOdd(12345678901235)
Debug.Print IsEven(12345678901235)
End Sub

returns...
False
True
True
False
--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Tommi" wrote in message
...
How to check in VBA code if number is even (or odd)?