Excel CCur Function (VBA)
-function/ccur-function-vba-code.jpg)
How to use the CCur Function (VBA)
This Excel tutorial explains how to use the Excel CCur function with syntax and examples using VBA.
SUMMARY:
The Excel VBA CCur function converts an expression into a Currency data type.
For example,
- The VBA Code CCur(10) would return 10
- The VBA Code CCur(33.955555) would return 33.9556
PURPOSE:
To converts a value to a Currency.
RETURN VALUE:
The CCur function returns a Currency value.
SYNTAX:
CCur( expression )
ARGUMENTS:
The CCur function syntax has the following arguments:
- expression: Required. The expression is that you want to convert to a Currency.
- The "expression" can be any number between -922,337,203,685,477.5808 and 922,337,203,685,477.5807
REMARKS:
- The CCur function can only be used in VBA code in Microsoft Excel.
- The Currency data type has a maximum of 15 digits to the left of the decimal place.
- The Currency data type has a maximum of 4 digits to the right of the decimal place.
- It can hold values between -922,337,203,685,477.5808 and 922,337,203,685,477.5807
- An overflow error will occur if the value is out of range.
- The Currency data type is a Value data type.
- This function can be used to force currency arithmetic in cases where single precision, double precision or integer arithmetic would normally occur.
- This function recognises decimals and thousand separators based on the local settings.