Function Phrase(x)
Application.Volatile
Dim DC%, i%, j%, Buffer, T
DC = Cells(8, Columns.Count).End(xlToLeft).Column ' Dernère colonne utilisée en lig 7
T = Range(Cells(6, 2), Cells(7, DC)) ' Lignes 6 et 7 dans tableau T
For i = 1 To UBound(T, 2) ' Tri croissant sur ligne 6
For j = i To UBound(T, 2)
If T(1, i) > T(1, j) Then
Buffer = T(1, i): T(1, i) = T(1, j): T(1, j) = Buffer
Buffer = T(2, i): T(2, i) = T(2, j): T(2, j) = Buffer
End If
Next j
Next i
For i = 1 To UBound(T, 2) ' Concaténation des paramètres
If T(1, i) <> "" Then Phrase = Phrase & T(2, i) & ", "
Next i
If Phrase <> "" Then Phrase = Mid(Phrase, 1, Len(Phrase) - 2) Else Phrase = "" ' Suppression du "," final
End Function