View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dyl Dyl is offline
external usenet poster
 
Posts: 10
Default VBA is odd function

You could use the mod operator which finds the remainder. So if a
number is divided by 2 and the remainder is 1, then it is odd. If a
number is divided by 2 and the remainder is 0, then it is even.

Try this:

Temp = Val("Text") <--Put text in number format

If Temp Mod 2 = 1 Then <--Odd
......

Else '<---Even
........