#1   Report Post  
Posted to microsoft.public.excel.misc
aftamath
 
Posts: n/a
Default Even and Odd

IS there a keyword in Visual Basic that recognizes whether a number is odd or
even.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default Even and Odd

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

--
Kind regards,

Niek Otten

"aftamath" wrote in message
...
IS there a keyword in Visual Basic that recognizes whether a number is odd
or
even.



  #3   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default Even and Odd

You could 'roll your own'

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

--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"aftamath" wrote in message
...
IS there a keyword in Visual Basic that recognizes whether a number is odd
or
even.



  #4   Report Post  
Posted to microsoft.public.excel.misc
aftamath
 
Posts: n/a
Default Even and Odd

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.

"Niek Otten" wrote:

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

--
Kind regards,

Niek Otten

"aftamath" wrote in message
...
IS there a keyword in Visual Basic that recognizes whether a number is odd
or
even.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"