Excel: CBool Function (VBA only)
In Excel, the CBool function converts a value to a boolean.
The syntax for the CBool function is:
CBool( expression )
Applies To:
- Excel 2007, Excel 2003, Excel XP, Excel 2000
VBA Code
The CBool function can only be used in VBA code. For example:
Dim LCompare as Boolean
LCompare = CBool(1=2)
In this example CBool(1=2) would return false. The variable LCompare would now contain the value false.
