VBA & Macro Problems

Fix Excel VBA Currency Values Rounded to Two Decimal Places

Jason MillerJason Miller Nov 25, 2026 871 views

Question details

The user needs to preserve the intended decimal places when writing a VBA Currency value to an Excel cell.

Fix Excel VBA Currency Values Rounded to Two Decimal Places
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the macro

In Excel, open the Visual Basic Editor and locate the procedure that writes the price to the worksheet.

2
Change the assignment

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.

3
Show four decimal places

Select the destination cell, open Format Cells, and choose Number with four decimal places. Run the macro again and check the result.

Use Range.Value2 to write Currency values
Currency precision limit: A value such as 12.34454 is reduced to 12.3445 when stored in a Currency variable, before it is written to the cell.
Free Microsoft Office alternative

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.

Adjust spreadsheet number formats to display the decimal places you needOpen and edit Microsoft Excel XLSX and XLS spreadsheet filesUse a familiar, easy-to-learn spreadsheet interfaceMove existing spreadsheets into a lightweight office suite
microsoft office alternative - wps office

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.