Function Math Reals Class

Min3Variant

" Minimum Of Three Variant Values" Return the minimum of three arguments. Returns the leftmost of the minimum arguments.

Signature (Visual Basic / VBA)

Public Function Min3Variant( _
      ByVal vValue1 As Variant _
    , ByVal vValue2 As Variant _
    , ByVal vValue3 As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Code Example

    Min3Variant(23, 45, 56) = 23
    Min3Variant(-12, 12, 4) = -12
    Min3Variant(2%, 2#, 2!) = 2%
    Min3Variant("SA", "RO", "EN") = "EN"
    Min3Variant("SA", "ro", "en") = "SA"
    Min3Variant("SA", "ro", "en", vbTextCompare) = "en"

Parameters

Parameter Description
vValue1 First of three values, the minimum of which will be returned.
vValue2 Second of three values, the minimum of which will be returned.
vValue3 Third of three values, the minimum of which will be returned.
vCompare specifies the type of string comparison used to determine if strings match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Notes & Version History

Note Arguments are compared using the CompareLikeDataType function; see it for more details of how arguments are fixed up and comparisons are performed.
Note This function does not support three-valued logic because of the way that the CompareLikeDataType function treats Null values.