Function Math Statistics Class

MaximumArray

Maximum of numeric values. More efficient version of the Maximum Function but with restrictions on the arguments it accepts.

Signature (Visual Basic / VBA)

Public Function MaximumArray( _
    ByRef vValues As Variant _
    ) As Variant

Code Example

    MaximumArray(Array(34, 12, 56)) = 56
    MaximumArray(SampleData) = 215

Parameters

Parameter Description
vValues Numeric-type array or Variant array containing only numeric elements. This function is NOT affected by the current setting of the StatVarType Property. It assumes that vValues is an array that contains only numeric elements.

Return Value

Function returns the maximum numeric value within the array. Function returns Null if there is some type of error, such as if the argument is a Variant array which contains an Object reference or String.