Thread: MOD function
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Earl Kiosterud[_4_] Earl Kiosterud[_4_] is offline
external usenet poster
 
Posts: 25
Default MOD function

Srikanth,

There is no MOD function in VBA, but there is a Mod operator. So you would
write:

IF n Mod 2 = 1 then
PosX = -190 ...

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Srikanth Ganesan" wrote in message
...

Hello,

How do I do the following in a macro

IF MOD(n,2) = 1 Then posX = -190 Else posX = 150


where n is an integer, posX is a Long.

Srikanth

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!