Whoops.... forgot the code
It came from Skip at this site
Function WhatMax(Position, ParamArray x())
Dim m1, m2, m3, tmp
For i = LBound(x, 1) To UBound(x, 1)
If x(i) > m1 Then
m3 = m2
m2 = m1
m1 = x(i)
Else
If x(i) > m2 And x(i) <> m1 Then
m3 = m2
m2 = x(i)
Else
If x(i) > m3 And x(i) <> m2 Then
m3 = x(i)
End If
End If
End If
Next
Select Case Position
Case 1
WhatMax = m1
Case 2
WhatMax = m2
Case 3
WhatMax = m3
Case Else
WhatMax = "Tilt!"
End Select
End Function