Modification VBA recherche dans textbox

Bonjour a tous,

je me suis inspiré de ce tuto pour refaire la recherche par textbox :

fils : https://www.blog-excel.com/creer-un-champ-de-recherche-vba/

j'ai utilisé ce code :

Option Compare Text

Private Sub TextBox1_Change()

    Application.ScreenUpdating = False

    Range("C3:C24", "F3:F24", "I3:I24").Interior.ColorIndex = 2
    ListBox1.Clear

    liste_colonnes = Array(3, 6, 9) 'C F I

    If TextBox1 <> "" Then
        For ligne = 3 To 24
            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 = 43
                    ListBox1.AddItem Cells(ligne, colonne)
                End If
            Next
        Next
    End If

End Sub

mais j'ai un message d erreur il y a trop d'arguments, pouvez vous m'aider s'il vous plait...

Bonjour,

Range("C3:C24, F3:F24, I3:I24")....

Cordialement.

Merci beaucoup, résolu et marche nickel :

Option Compare Text

Private Sub TextBox1_Change()

    Application.ScreenUpdating = False

    Range("C3:C24, F3:F24, I3:I24").Interior.ColorIndex = 2
    ListBox1.Clear

    liste_colonnes = Array(3, 6, 9, 10) 'C F I J

    If TextBox1 <> "" Then
        For ligne = 2 To 24
            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 = 43
                    ListBox1.AddItem Cells(ligne, colonne)
                End If
            Next
        Next
    End If

End Sub
Rechercher des sujets similaires à "modification vba recherche textbox"