Fix Excel VBA Currency Values Rounded to Two Decimal Places
Question details
The user needs to preserve the intended decimal places when writing a VBA Currency value to an Excel cell.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- A VBA macro writes a Currency variable to an Excel range using Range.Value.
- Observed behavior
- The cell's displayed or stored result can be rounded to two decimal places, even though the VBA Currency type supports four decimal places.
Find the macro line that writes the value to the cell and check the variable's declared data type. In Excel, also select the destination cell and check its number format, since formatting can hide decimal places without changing the stored value.
Use Range.Value2 to write Currency values
Use Value2 to avoid the special Currency handling associated with Range.Value.
VBA Currency stores four decimal places. Converting an existing Currency value to Double cannot restore digits that were lost when the value was assigned to Currency.
In Excel, open the Visual Basic Editor and locate the procedure that writes the price to the worksheet.
Replace the Range.Value assignment with Value2, for example: rng.Value2 = CDbl(price). This writes the existing Currency value as a Double without Range.Value's special Currency handling.
Select the destination cell, open Format Cells, and choose Number with four decimal places. Run the macro again and check the result.

Use Double when the source needs more than four decimal places
Use a Double variable from the start when the value needs more precision than VBA Currency provides.
Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and support for common Excel formats, making it easy to bring existing workbooks into your workflow. It does not fix Excel's VBA Currency handling; check macro compatibility before migrating automated workbooks.

Frequently Asked Questions
Why does my Excel cell show only two decimal places?
The cell may be formatted to show only two decimal places. Select it, open Format Cells, and increase the decimal places under Number. If the stored value was already rounded, formatting alone will not restore the missing digits.
What is the difference between Range.Value and Range.Value2?
Range.Value handles Currency and Date values specially. Range.Value2 does not use those data types, making it the preferred property for writing a numeric value without that special handling.
Can CDbl restore digits lost in a Currency variable?
No. Currency stores four decimal places, so any extra precision is lost before CDbl converts the value. Declare and assign the original value as Double if you need more than four decimal places.
Should I use Single instead of Double for prices?
Single has limited precision, so Double is generally a better choice when more precision is needed. For calculations requiring exact decimal behavior, account for floating-point rounding when using Double.




