Home Privacy Policy Feedback Link to us Site Map Forums

Excel: CDec Function (VBA only)


In Excel, the CDec function converts a value to a decimal number.

The syntax for the CDec function is:

CDec( expression )


Applies To:

  • Excel 2007, Excel 2003, Excel XP, Excel 2000

VBA Code

The CDec function can only be used in VBA code. For example:

Dim LDecimal As Double

LDecimal = CDec(8.45 * 0.005 * 0.01)

The variable called LDecimal would now contain the value of 0.0004225.