Function Math Miscellaneous Class

MinOfVarType

" Minimum Value Of Numeric Data Type" Returns the minimum value of a numeric data type given its vb constant such as vbInteger, vbSingle, etc.

Signature (Visual Basic / VBA)

Public Function MinOfVarType(ByVal vVarType As Variant) As Variant

Code Examples

    MinOfVarType(vbBoolean) = -1
    MinOfVarType(vbByte) = 0
    MinOfVarType(vbDate) = #1/1/100#
    vbArray not supported.
    vbBoolean (same as MinBoolean)
    vbByte (same as MinByte)
    vbCurrency (same as MinCurrency)
    vbDataObject not supported.
    vbDate (same as MinDate)
    vbDecimal (same as MinDecimal)
    vbDouble (same as MinDouble)
    vbEmpty not supported.
    vbError not supported.
    vbInteger (same as MinInteger)
    vbLong (same as MinLong)
    vbNull not supported.
    vbObject not supported.
    vbSingle (same as MinSingle)
    vbString not supported.
    vbVariant not supported.

Parameters

Parameter Description
vVarType The numeric constant which represents a specific Visual Basic data type. Function returns Null if vVarType is Null or cannot be fixed up to a number.

Notes & Version History

Note Function currently recognizes the following Visual Basic data types: Function returns Null if vVarType does not represent the VarType value of a Visual Basic data type.
v1.5 Change This function has been extended to support the new Decimal data type in VB 6.0,