Function Liste(r As Range)
Dim d As Object, x$, a
Set d = CreateObject("Scripting.Dictionary")
For Each r In r
x = Application.Proper(Trim(CStr(r)))
If x <> "" Then d(x) = "" 'liste sans doublon
Next
a = d.keys
tri a, 0, UBound(a)
'---restitution---
Liste = a 'vecteur horizontal
End Function
Sub tri(a, gauc, droi) ' Quick sort
Dim ref, g, d, temp
ref = a((gauc + droi) \ 2)
g = gauc: d = droi
Do
Do While a(g) < ref: g = g + 1: Loop
Do While ref < a(d): d = d - 1: Loop
If g <= d Then
temp = a(g): a(g) = a(d): a(d) = temp
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then Call tri(a, g, droi)
If gauc < d Then Call tri(a, gauc, d)
End Sub