Re : Filtre par textbox sur listbox
Bonsoir Wilfired, le forum,
Je te remercide ton aide, j'ai un souci l'intégration du code que tu as modifié n'affiche pas sur cinq colonne mais seulement sur une et je ne comprend pas pourquoi, puique j'ai collé ton code, la seule modif faite et de remplacer feuil1 par sheets(1).
je te livre le code :
Private Sub TextBox1_AfterUpdate()
Dim Plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim Ligne As Variant
Dim C As Object
'ListBox1.Clear
Recherche = TextBox1.Value
Range("A1").Select
Ligne = Sheets(1).Range("B" & "65536").End(xlUp).Row
Set Plage = Sheets(1).Range("B" & "2:" & "B" & Ligne)
With Plage
Set C = .Find(Recherche)
If Not C Is Nothing Then
Adresse = C.Address
Do
If UCase(Recherche) = UCase(Left(C, Len(Recherche))) Then
ListBox1.AddItem ""
ListBox1.List(ListBox1.ListCount - 1, 0) = C.Offset(0, -1)
ListBox1.List(ListBox1.ListCount - 1, 1) = C
ListBox1.List(ListBox1.ListCount - 1, 2) = Format(C.Offset(0, 1), "### ##0.00")
ListBox1.List(ListBox1.ListCount - 1, 3) = C.Offset(0, 2)
ListBox1.List(ListBox1.ListCount - 1, 4) = C.Offset(0, 3)
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> Adresse
End If
End With
End Sub
Par avance mercide ton aide
a+
Yvon,