Bonjour,
Je souhaiterai que lorsque je clic sur un résultat de ma listebox ça me renvoie vers la ligne correspondante.
Et deuxième point lorsque je fais une recherche dans la textebox ça me redimensionne la listebox, est-il possible de la figer?
Voici le code:
Option Compare Text
Private Sub TextBox1_Change()
Application.ScreenUpdating = False
Range("B2:B10000", "D2:D10000").Interior.ColorIndex = 2
ListBox1.Clear
ListBox1.ColumnCount = 1
liste_colonnes = Array(2, 4) 'A B C J
If TextBox1 <> "" Then
For ligne = 2 To 10000
For no_colonne = 0 To UBound(liste_colonnes)
colonne = liste_colonnes(no_colonne)
If Cells(ligne, colonne) Like "*" & TextBox1 & "*" Then
Cells(ligne, colonne).Interior.ColorIndex = 4
ListBox1.AddItem Cells(ligne, 1) & " - " & Cells(ligne, 2) & " - " & Cells(ligne, 4) & " - " & Cells(ligne, 5) & " - " & Cells(ligne, 6) & " - " & Cells(ligne, 7)
End If
Next
Next
End If
End Sub
Merci de votre aide.