Bonjour,
J'ai une simple recherche. Dans la colonne à rechercher il y a des couleurs.
Dans le code si dessous, quand il recherche il remet la couleur d'origine blanc.
Y'a-t-il un moyen d'enlever ce petit bout de code pour garder la couleur affecter à ma cellule que j'ai choisie ?
Private Sub TextBox1_Change()
Application.ScreenUpdating = False
Range("F9:F50000").Interior.ColorIndex = 2
ActiveWindow.ScrollRow = 1
With Me.ListBox1
.Clear
.ColumnCount = 2
End With
If TextBox1 <> "" Then
For ligne = 1 To 50000
If Cells(ligne, 6) Like TextBox1 & "*" Then
Cells(ligne, 6).Interior.ColorIndex = 42
ListBox1.AddItem Cells(ligne, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = ligne
End If
Next
End If
End Sub