The code at the link seems a bit lengthy unless you need it for a query, I guess. Otherwise, as long as you won't ever have more than 3 values the code solution would work, but I'd hate to see how convoluted it would get if a 4th value was introduced. Here's something I wrote that seems to work with lists of different lengths & should with any number type I think.
Code:
Function GetMaxVal(ParamArray aryValues() As Variant) As Variant
Dim i As Variant, varCurMax As Variant
varCurMax = aryValues(0)
For i = 1 To UBound(aryValues)
If varCurMax < aryValues(i) Then varCurMax = aryValues(i)
Next
GetMaxVal = varCurMax
End Function
?getmaxval (21,2,3,7,6,5,11) = 21
?getmaxval (2,3,7,6,5,1) = 7
?getmaxval (1,2,3,7,6,5,11) = 11
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.