Recommended Answers
Jump to PostTimer.Enabled = False works for me, there should be no need to work round it like that. Did you follow that with an Exit Sub? If not, then the rest of the sub will execute, maybe something in there enables it again?
Jump to PostSay your variable is called x.
If x / 2 = Int(x / 2) then it's even, otherwise it's odd. That should work for you. The Int function rounds down to the nearest whole number.
Jump to Postyou could try this one
If X Mod 2 Then ' // Odd Number Here Else ' // Even Number Here End If
Jump to PostHi, Invisal, I know I should have done a proper example, like
If x / 2 = Int (x / 2) Then 'it's even so do something Else 'it's odd, so do something else End if
Just wondering about that 'Mod 2'. Haven't seen it before, can …
All 13 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.