View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Determine if Integer is Odd or Even

If you will encounter negative numbers, you might want to modify it to

Function myIsOdd(i As Integer) As Boolean
myIsOdd = (Abs(i Mod 2) = 1)
End Function

or use Leith Ross's "AND" approach.

--
Regards,
Tom Ogilvy


"GoFigure" wrote in
message ...

Thanks everyone. Using the MOD function works great.


--
GoFigure
------------------------------------------------------------------------
GoFigure's Profile:

http://www.excelforum.com/member.php...fo&userid=4274
View this thread: http://www.excelforum.com/showthread...hreadid=492937