MOD function

S

Stratuser

I'm having trouble finding the MOD function. It doesn't
seem to be accessible through WorksheetFunction. Anybody
know how I can access it?
 
K

KennyG

What are you trying to do? I'm not sure why it doesn't appear in
WorksheetFunction's list, but it might have to do with the fact that VBA has
a MOD function, e.g.

MyRemainder = 19 MOD 5

To enter a formula in a cell via VBA use:
ActiveCell.Formula = "=Mod(cell1, cell2)"

Hope this helps

KennyG
(e-mail address removed)
 
T

Tom Ogilvy

VBA has a MOD operater

21 Mod 5

from the immediate window

? 21 Mod 5
1

I believe there is some operational difference for fractional arguments

http://support.microsoft.com/default.aspx?scid=kb;en-us;214271
XL2000: MOD Function and Mod Operator Return Different Values

http://support.microsoft.com/default.aspx?scid=kb;en-us;141178
XL: MOD Function and Mod Operator Return Different Values
Just for interest:

http://support.microsoft.com/default.aspx?scid=kb;en-us;225330
OFF2000: New Round Function in Visual Basic for Applications 6.0


Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top