CVar Function Description
The VBA CVar function converts an expression (variable) to Variant data type.
Syntax
The syntax for the CVar function in VBA is:
1 | CVar( expression ) |
Parameters
expression
An expression / variable that is to be converted to Variant data type.
Other Notes
Example usage
The CVar function can be used in VBA code. Let’s look at some VBA CVar function examples:
1 2 3 4 5 | CVar "10" 'Result: "10" (Variant/String) CVar 10 'Result: 10 (Variant/Integer) |