'le plus grand
Function maxInJoinTexteIncolumn(r As Range)
Dim tbl(), T
T = Application.Transpose(Application.index(r, 0, 1))
T = "{" & Replace(Join(T, "-"), "-", ",") & "}"
tbl = Evaluate(T)
maxInJoinTexteIncolumn = Application.WorksheetFunction.Max(Array(tbl()))
End Function
Sub test3()
MsgBox maxInJoinTexteIncolumn([A1:A3])
End Sub
'le N eme plus grand
Function maxInJoinTexteIncolumn2(r As Range, Optional index& = 1)
Dim tbl(), T
T = Application.Transpose(Application.index(r, 0, 1))
T = "{" & Replace(Join(T, "-"), "-", ",") & "}"
tbl = Evaluate(T)
maxInJoinTexteIncolumn2 = Application.WorksheetFunction.Large(tbl, index)
End Function
Sub test4()
MsgBox maxInJoinTexteIncolumn2([A1:A3], 1)' le premier'
MsgBox maxInJoinTexteIncolumn2([A1:A3], 3)' le 3 eme
End Sub