Function Convert Values Class

NonZeroToTrue

Return true if the argument is a non-zero numeric, date, numeric string, or date string value. Function returns False in all other cases.

Signature (Visual Basic / VBA)

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

Code Example

    NonZeroToTrue(0) = False
    NonZeroToTrue(1) = True
    NonZeroToTrue(345) = True
    NonZeroToTrue("0") = False
    NonZeroToTrue("345") = True
    NonZeroToTrue("Word") = False
    NonZeroToTrue(Null) = False

Parameters

Parameter Description
vValue The value which is checked to see if it is True. vValue can be a number, a date, a numeric string, or a date string. Function returns False if vValue is Null or cannot be fixed up to a number or date.