View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
LesHurley LesHurley is offline
external usenet poster
 
Posts: 61
Default VBA Mod, Excel Floor, etc.

-5.4-Round(-5.4,0) = -.4: thats OK but -5.6-Round(-5.6,0) = +.4: Not OK in
general but it would work OK for my particular application since I am testing
if the fractional part is zero.
--
Thanks for your help


"Jim Thomlinson" wrote:

perhaps...

N-Round(N, 0)
--
HTH...

Jim Thomlinson


"LesHurley" wrote:

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