Function Math Reals Class

MaxReal

" Maximum Of Real Numbers" Return the maximum value of the numeric arguments. The arguments must contain strings or numbers, but not both. Function returns the leftmost of the maximum arguments.

Signature (Visual Basic / VBA)

Public Function MaxReal( _
    ParamArray vArgs() As Variant _
    ) As Variant

Code Example

    MaxReal(23) = 23
    MaxReal(23, 12) = 23
    MaxReal(12, 45, 23) = 45
    IsNull(MaxReal) = True

Parameters

Parameter Description
vArgs One or more numeric arguments, the maximum of which is returned. Function returns Null if there are no arguments.

Notes & Version History

Note If all arguments happen to be strings, they will be compared using Binary comparisons.
Note This function will generate an error if any of the arguments are not compatible, such as if one is a string and another is numeric.
Note This function does not support three-valued logic. The behavior of this function is undefined if any of the arguments are Null.