odd or even number

  • Thread starter Thread starter Maileen
  • Start date Start date
M

Maileen

Hi,

In my form, i need to find if a number is odd or even.
How can i do it ?

ISODD or ISEVEN are only function from worksheet, but in my case, the
number that i have to test is the row of my listview.
so a simple INT variable.
thanks a lot.
Maileen
 
Hi Maileen
You can use Mod in VBA

Sub test()
If ActiveCell.Value Mod 2 = 0 Then
MsgBox "Even"
Else
MsgBox "odd"
End If
End Sub
 
Back
Top