Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Simple VBA devision problem

Use Double instead of Long

Look at Data Type Summary if your version has this in Help
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Simple VBA devision problem



ahhhhh .. grand.. thanks

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

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple IF problem Trevor Aiston[_2_] Excel Worksheet Functions 0 September 12th 09 03:18 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple problem I'm sure John New Users to Excel 1 February 15th 06 01:37 AM
another simple problem... London Excel Worksheet Functions 8 July 22nd 05 08:43 PM
Simple problem inquirer Excel Discussion (Misc queries) 4 April 16th 05 12:37 PM


All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"