Function Math Miscellaneous Class

MaxOfVarType

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

Signature (Visual Basic / VBA)

Public Function MaxOfVarType(ByVal vVarType As Variant) As Variant

Code Examples

    MaxOfVarType(vbBoolean) = 0
    MaxOfVarType(vbByte) = 255
    MaxOfVarType(vbDate) = #12/31/9999 11:59:59 PM#
    vbArray not supported.
    vbBoolean (same as MaxBoolean)
    vbByte (same as MaxByte)
    vbCurrency (same as MaxCurrency)
    vbDataObject not supported.
    vbDate (same as MaxDate)
    vbDecimal (same as MaxDecimal)
    vbDouble (same as MaxDouble)
    vbEmpty not supported.
    vbError not supported.
    vbInteger (same as MaxInteger)
    vbLong (same as MaxLong)
    vbNull not supported.
    vbObject not supported.
    vbSingle (same as MaxSingle)
    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,