View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
phillip harrison phillip harrison is offline
external usenet poster
 
Posts: 9
Default Simple VBA devision problem

Hi there

I've got a problem which envolves simple devision with decimals but VBA
is rounding it to an integer.

My code is this:

NumBound = MaxValue / SharedValues

All 3 values are defined as Long

The problem comes when MaxValue is, say 8113.567235, SharedValues is,
say 18236 and thus NumBound should equal 0.4449203 but comes up as 0.

This then results in my further calcuations producing an error as I have
to devide by NumBound, i.e. 0 which is not possible.

Any help would be greatly appreciated

Thanks

Phillip

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!