Option Compare Text 'la casse est ignorée
Private Sub CheckBox1_Click()
TextBox1_Change
End Sub
Private Sub CommandButton1_Click()
Dim F As Worksheet, deb As Range, i&, n&
Set F = Feuil5 'CodeName de la feuille de restitution
Set deb = F.Range("E" & F.Rows.Count).End(xlUp)(2)
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
n = n + 1
deb(n) = ListBox1.List(i)
End If
Next
End Sub
Private Sub TextBox1_Change()
Dim vide As Boolean, t, i&, n&
vide = TextBox1 = ""
ListBox1.Clear
t = [Liste].Resize(, 2) 'pour avoir au moins 2 éléments
For i = 1 To UBound(t)
If t(i, 1) Like IIf(Not CheckBox1, "*", "") & TextBox1 & "*" Then
ListBox1.AddItem t(i, 1)
If Not vide Then ListBox1.Selected(n) = True
n = n + 1
End If
Next
End Sub
Private Sub UserForm_Initialize()
TextBox1_Change
End Sub