View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Mod(number;divisor)

Mod is an operator in VBA

remainder = 23 mod 10
? remainder
3

Note that the behavior is somewhat different from the Excel function for
non integers. See help.

--
Regards,
Tom Ogilvy

"Mhek" wrote:


I would like to get the remainder in a script.

In an excel sheet, I use to write remainder = Mod(number;divisor)

but that function doesn't work with a VBA script.

I tried number%divisor (like I would do in C++) but it didn't work.

What should I do ?

Frank


--
Mhek
------------------------------------------------------------------------
Mhek's Profile: http://www.excelforum.com/member.php...o&userid=33427
View this thread: http://www.excelforum.com/showthread...hreadid=534121