VBA Mod, Excel Floor, etc.
Same comment as for Gary's suggestion.
--
Thanks for your help
"Bob Phillips" wrote:
This works as the Excel Mod does
Dim N As Double
Dim remain As Double
Dim sign As Boolean
N = 123.456
sign = N < 0
remain = N - Int(N)
MsgBox remain
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"LesHurley" wrote in message
...
In VBA, I want to find the fractional part of a number, say N=123.456.
The
VBA version of Mod rounds N to an integer before it functions. The
WorksheetFunction Mod() isn't available in VBA. WorksheetFunction.Floor()
is
available but it wont work with a negative N. Can anyone suggest how to
do
this for any real N?
--
Thanks for your help
|