Option Compare Text
Dim f
Private Sub UserForm_Initialize()
Dim temp
Dim mondico
Dim c As Range
Set f = Sheets("Feuil1")
Set mondico = CreateObject("Scripting.Dictionary")
For Each c In Range(f.[A2], f.[A65000].End(xlUp))
If c.Value <> "" Then mondico.Item(c.Value) = c.Value
Next c
temp = mondico.items
Call tri(temp, LBound(temp), UBound(temp))
Me.ComboBox1.List = temp
End Sub
Sub tri(a, gauc, droi) ' Quick sort
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
Private Sub CommandButton2_Click()
Unload Userform1
End Sub
Private Sub ComboBox1_Click()
Set f = Sheets("Feuil1")
ligne = f.[A:A].Find(ComboBox1.Value, LookIn:=xlValues).Row
Me.TextBox1 = f.Cells(ligne, 2)
Me.TextBox2 = f.Cells(ligne, 3)
Me.TextBox3 = f.Cells(ligne, 4)
Me.TextBox4 = f.Cells(ligne, 5)
Me.TextBox5 = f.Cells(ligne, 5)
End Sub