Filtre lultiple sur listbox
Bonjour,
je debute en VBA et je demande un peu d'aide.
J'ai un textbox qui me permet de filtrer une liste en fonction d'un critere (Article / colonne B) et affiche les resultats dans une listbox
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| Private Sub TextBox1_Change()
Dim Plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim Ligne As Integer, N As Integer
Dim C As Range
ListBox1.Clear
N = 0
Recherche = TextBox1.Value
Range("A1").Select
Ligne = Feuil2.Range("B" & "65536").End(xlUp).Row
Set Plage = Feuil2.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
'alimentation listBox
ListBox1.AddItem C.Offset(0, -1), N
ListBox1.List(N, 1) = C
ListBox1.List(N, 2) = C.Offset(0, 1)
ListBox1.List(N, 3) = C.Offset(0, 2)
ListBox1.List(N, 4) = C.Offset(0, 3)
N = N + 1
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> Adresse
End If
End With
End Sub |
Maintenant j'aimerais réaliser un 2eme filtre (ici sur le prix / colonne C) grace a une 2eme textbox.
Je n'arrive pas trouver de code.
Pouvez vous m'aider ?
Merci