VBA CDbl function

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

CDbl Function Description

The VBA CDbl function converts an expression (variable) to Double data type.

Syntax

The syntax for the CDbl function in VBA is:

CDbl( expression )

Parameters

expression
An expression / variable that is to be converted to Double data type.

Other Notes

If the expression / variable can’t be converted to a Date, the function with return Error code 13: Type mismatch.

Example usage

The CDbl function can be used in VBA code. Let’s look at some VBA CDbl function examples:

CDbl 10
'Result: 10

CDbl 10.6
'Result: 10.6

CDbl "20"
'Result: 20

CDbl 10.12345678901234
'Result: 10,1234567890123 

Simply the best place to learn VBA!

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match