Public Function basMinVal(ParamArray varMyVals() As Variant) As Variant
'Michael Red 10/25/2001
'To return the MINIMUM or a series of values
'Sample Usage:
'? basMinVal(1, 5, 9, 3, 13.663)
'1
'?basMinVal(9, 1, 5, 3, 13.663)
'1
Dim Idx As Integer
Dim MyMin As Variant
If (UBound(varMyVals) < 0) Then
Exit Function
Else
MyMin = varMyVals(0)
End If
For Idx = 0 To UBound(varMyVals())
If (varMyVals(Idx) < MyMin) Then
MyMin = varMyVals(Idx)
End If
Next Idx
basMinVal = MyMin
End Function
[code]
with following 'results':
? basMinval(#09/01/02#, Null, #07/01/02#)
7/1/02
MichaelRed
m.red@att.net
There is never time to do it right but there is always time to do it over