Function Convert Values Class

CBoolIgnErr

"Convert To Boolean Ignore Errors" Attempt to convert vValue to a Boolean value. Return vValue as a Boolean value if the conversion was successful. Return False if vValue could not be converted to a Boolean.

Signature (Visual Basic / VBA)

Public Function CBoolIgnErr( _
    ByVal vValue As Variant _
    ) As Boolean

Code Example

    CBoolIgnErr(34) = True
    CBoolIgnErr(0) = False
    CBoolIgnErr("1") = True
    CBoolIgnErr("0") = False
    CBoolIgnErr("Word") = False

Parameters

Parameter Description
vValue The value which will be converted to a Boolean and returned (if conversion is possible). Conversion is not possible if vValue is Null, an Error, an Object, or a non-numeric String. All non-zero numeric values are converted to True and numeric values of 0 (zero) are converted to False.