BERRACHED said
XLDnaute Accro
Salut Mes amis
ca fait des jours que j'éssayer de régler un probléme mais on dirait que ca coince voila dans mon userforme j'ai ajouter un textbox pour pouvoir facilter la Recherche sur ma listbox seulement le processus de recherche ne fonctionne qu'au démarrage si je click sur un item de la listbox le textbox cale il ne fonctionne plus et il faudrait que je quiitte complétement l'application pour y retourner le fichier est grand pour pouvoir le joindre mais voila les code qui sont associes a l'application :
Private Sub ListBox1_Click()
Dim cel As Range, Ligne As Range, info As Range, Depart$
Me.ListView2.ListItems.Clear
With [Paiements].Columns(2)
Set cel = .Find(ListBox1, LookIn:=xlValues, LookAt:=xlWhole)
x = 0
If Not cel Is Nothing Then
Depart = cel.Address
Do
Set Ligne = Range(cel.Offset(0, -1), cel.Offset(0, 4))
With Me.ListView2
x = x + 1
.ListItems.Add , , Ligne(1)
For y = 4 To 6
.ListItems(x).ListSubItems.Add , , Ligne(y)
Next y
End With
Set cel = .FindNext(cel)
Loop While Not cel Is Nothing And cel.Address <> Depart
End If
End With
Set cel = [Rentes].Columns(1).Find(ListBox1, LookIn:=xlValues, LookAt:=xlWhole)
If Not cel Is Nothing Then Set info = cel.Resize(, 4) Else Exit Sub
TextBox1 = info(1)
TextBox2 = info(2)
TextBox3 = info(3)
TextBox4 = info(4)
End Sub
Private Sub TextBox8_Change()
Dim plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim N As Integer
Dim c As Range
N = 0
ini
Recherche = TextBox8.Value
'Range("A1").Select
DerLigne = Sheets("Liste").Range("B" & "65536").End(xlUp).Row
Set plage = Sheets("Liste").Range("B" & "2:" & "B" & DerLigne)
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
Private Sub ini()
Me.ListBox1.Clear ' remet la liste à jours
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox7 = ""
End Sub
je vous remercie d'avance de votre aide
ca fait des jours que j'éssayer de régler un probléme mais on dirait que ca coince voila dans mon userforme j'ai ajouter un textbox pour pouvoir facilter la Recherche sur ma listbox seulement le processus de recherche ne fonctionne qu'au démarrage si je click sur un item de la listbox le textbox cale il ne fonctionne plus et il faudrait que je quiitte complétement l'application pour y retourner le fichier est grand pour pouvoir le joindre mais voila les code qui sont associes a l'application :
Private Sub ListBox1_Click()
Dim cel As Range, Ligne As Range, info As Range, Depart$
Me.ListView2.ListItems.Clear
With [Paiements].Columns(2)
Set cel = .Find(ListBox1, LookIn:=xlValues, LookAt:=xlWhole)
x = 0
If Not cel Is Nothing Then
Depart = cel.Address
Do
Set Ligne = Range(cel.Offset(0, -1), cel.Offset(0, 4))
With Me.ListView2
x = x + 1
.ListItems.Add , , Ligne(1)
For y = 4 To 6
.ListItems(x).ListSubItems.Add , , Ligne(y)
Next y
End With
Set cel = .FindNext(cel)
Loop While Not cel Is Nothing And cel.Address <> Depart
End If
End With
Set cel = [Rentes].Columns(1).Find(ListBox1, LookIn:=xlValues, LookAt:=xlWhole)
If Not cel Is Nothing Then Set info = cel.Resize(, 4) Else Exit Sub
TextBox1 = info(1)
TextBox2 = info(2)
TextBox3 = info(3)
TextBox4 = info(4)
End Sub
Private Sub TextBox8_Change()
Dim plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim N As Integer
Dim c As Range
N = 0
ini
Recherche = TextBox8.Value
'Range("A1").Select
DerLigne = Sheets("Liste").Range("B" & "65536").End(xlUp).Row
Set plage = Sheets("Liste").Range("B" & "2:" & "B" & DerLigne)
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
Private Sub ini()
Me.ListBox1.Clear ' remet la liste à jours
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox7 = ""
End Sub
je vous remercie d'avance de votre aide