Thread: Odd or Even
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Odd or Even

One way:

Dim bEven As Boolean
bEven = variable Mod 2 = 0


Dim bOdd As Boolean
bOdd = variable Mod 2 = 1


In article ,
"PraxisPete" wrote:

Hi Everybody
I think this should be straight forward but brain is just not working today
How can I use VBA code to determine if the contents of a varible is odd or
even?

Many thanks