Private Sub TextBox1_Change()
Dim S As String, i As Long, Lmax As Long, Nbr As Long, k As Long, NbreCol As Long
Dim L, V, LigneOK, m As Long '<<< ligne modifiée
NbreCol = 2 '<---- Nombre de colonnes à prendre en compte
Dim Sht As Worksheet
Set Sht = Worksheets("Feuil1")
If TextBox1 <> "" Then
ListBox1.Clear
Lmax = Sht.Range("A" & Sht.Rows.Count).End(xlUp).Row
V = Range(Sht.Range("A2"), Sht.Cells(Lmax, NbreCol)).Value
ReDim LigneOK(1 To Lmax - 1) '<<< ligne modifiée
'-------------------------------------------------------------------------------------'
' si on ne veut qu'une présence du texte saisi en début de cellule, conserver l'instruction suiv.
'S = LCase(TextBox1) & "*"
' si le texte saisi peut se trouver n'importe où dans les cellules, conserver l'instructiion suiv.
S = S = "*" & LCase(TextBox1) & "*"
'-------------------------------------------------------------------------------------'
S = "*" & LCase(TextBox1) & "*"
For i = 1 To Lmax - 1
For m = 1 To NbreCol '<<< ligne modifiée
LigneOK(i) = False '<<< ligne modifiée
If LCase(V(i, m)) Like S Then '<<< ligne modifiée
LigneOK(i) = True '<<< ligne modifiée
Nbr = Nbr + 1 '<<< ligne modifiée
Exit For '<<< ligne modifiée
End If '<<< ligne modifiée
Next m '<<< ligne modifiée
Next i
If Nbr = 0 Then Exit Sub
ReDim L(0 To Nbr - 1, 0 To NbreCol - 1)
Nbr = -1
For i = 1 To Lmax - 1
If LigneOK(i) Then '<<< ligne modifiée
Nbr = Nbr + 1
For k = 0 To NbreCol - 1
L(Nbr, k) = V(i, k + 1)
Next k
End If
Next i
ListBox1.List = L
End If
ListBox1.ListIndex = -1
End Sub