Function max(ParamArray ListItems() As Variant)
Dim i As Integer
If UBound(ListItems) >= 0 Then
max = ListItems(0)
For i = 1 To UBound(ListItems)
If ListItems(i) > max Then max = ListItems(i)
Next i
End If
End Function
Function min(ParamArray ListItems() As Variant)
Dim i As Integer
If UBound(ListItems) >= 0 Then
min = ListItems(0)
For i = 1 To UBound(ListItems)
If ListItems(i) < min Then min = ListItems(i)
Next i
End If
End Function