Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Mod(number;divisor)
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=534122 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Mod(number;divisor)
rem = number MOD divisor
e.g rem = 51 MOD 6 HTH "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=534122 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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=534122 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sumif number is greater than a number but less than another number | Excel Discussion (Misc queries) | |||
How do I keep the divisor constant in calculating percentage remai | Excel Discussion (Misc queries) | |||
How to calculate number of occurencies of a specific number number | Excel Discussion (Misc queries) | |||
Change divisor if column is 0 | Excel Discussion (Misc queries) | |||
Rounding a number to a multiple quantity that adds to a fixed total number | Excel Worksheet Functions |