Dim montableau
Private Sub ComboBox1_Change()
Dim monNewTableau
ReDim monNewTableau(1 To UBound(montableau), 1 To 2)
With ComboBox1
For i = 1 To UBound(montableau)
If UCase(montableau(i, 1)) Like UCase(.Value) & "*" Then
a = a + 1
monNewTableau(a, 1) = montableau(i, 1): monNewTableau(a, 2) = montableau(i, 2)
End If
Next
If a > 0 Then .List = monNewTableau Else .List = montableau
.DropDown
End With
End Sub
Private Sub UserForm_Activate()
Dim plage As Range
With Sheets(1): Set plage = .Range("A4:B" & .Cells(Rows.Count, 1).End(xlUp).Row): End With
tableauBase plage, True
With ComboBox1: .MatchEntry = 2: .ColumnCount = 2: .List = montableau: End With
End Sub
Sub tableauBase(rng As Range, Optional Jumpdouble As Boolean = False)
Dim t, a&, i&, x&
t = rng.Value
ReDim montableau(1 To rng.Rows.Count, 1 To 2)
With Application: colcontrol = .Transpose(.Index(t, 0, 1)): End With
For i = 1 To UBound(t)
If t(i, 1) <> "" Then
If Jumpdouble Then x = Application.IfError(Application.Match(colcontrol(i), colcontrol, 0), 0) Else x = i
If x = i Then a = a + 1: montableau(a, 1) = t(i, 1): montableau(a, 2) = rng.Cells(i, 1).Row
End If
Next
End Sub