ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Capturing Decimal Values in Variable - Losing decimals when summin (https://www.excelbanter.com/excel-programming/340057-capturing-decimal-values-variable-losing-decimals-when-summin.html)

Mark

Capturing Decimal Values in Variable - Losing decimals when summin
 
I have a variable, "Current", that sums various dollar values from a range
based on certain criteria. However, when I report the total value of
"Current", I get a value that has been rounded. Where I expected to receive
243.25, I get 243.00

What do I need to do to capture the actual value?

Current is declared as Long


Mark

Capturing Decimal Values in Variable - Losing decimals when summin
 
Another board gave me the answer.

The sum is a currency, so

Dim Current as Currency is an option, as is
Dim current as Double

"Mark" wrote:

I have a variable, "Current", that sums various dollar values from a range
based on certain criteria. However, when I report the total value of
"Current", I get a value that has been rounded. Where I expected to receive
243.25, I get 243.00

What do I need to do to capture the actual value?

Current is declared as Long



All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com