Private Sub tbRecherche_Change()
Dim DerLigne&, Ligne&
ListBox1.Clear
With Worksheets("MaFeuille")
DerLigne = .Cells(Rows.Count, 2).End(xlUp).Row
For Ligne = 4 To [B65000].End(xlUp).Row
With .Cells(Ligne, 2) 'recherche sur la 2ème colonne
If .Value <> 0 Then
If InStr(LCase$(.Value), LCase$(tbRecherche)) > 0 Then
ListBox1.AddItem .Value
ListBox1.List(ListBox1.ListCount - 1, 1) = .Offset(0, 2).Value
ListBox1.List(ListBox1.ListCount - 1, 2) = .Offset(0, 5).Value
'ListBox1.ColumnWidths = "250pt;60pt;60pt"
End If
End If
End With
With .Cells(Ligne, 3) 'recherche sur la 3ème colonne
If .Value <> 0 Then
If InStr(LCase$(.Value), LCase$(tbRecherche)) > 0 Then
ListBox1.AddItem .Value
ListBox1.List(ListBox1.ListCount - 1, 0) = .Offset(0, -1).Value
ListBox1.List(ListBox1.ListCount - 1, 1) = .Offset(0, 1).Value
ListBox1.List(ListBox1.ListCount - 1, 2) = .Offset(0, 4).Value
'ListBox1.ColumnWidths = "250pt;60pt;60pt"
End If
End If
End With
Next Ligne
End With
If Me.tbRecherche = "" Then Call test
End Sub