Compter le nombre d'occurrence d'un textbox dans une colone

Bonsoir

svp je souhaite avoir le code du CommandButton3_Click() qui affiche un msgbox indiquant le nombre de fois ou la valeur textbox1 est répétée dans la colonne A de la feuille 1

ci-joint mon fichier

34test1.xlsm (85.21 Ko)

Bonjour,

Je ne vois aucun code concernant un "Command_Bouton_Click" ....

Que veux tu exactement et dans quelle but ?

Amitiés

Bonjour,

Pour le principe.

A adapter.

Cdlt.

Private Sub CommandButton3_Click()
Dim ws As Worksheet, lastRow As Long, rng As Range
    Set ws = Worksheets("Feuil1")
    With ws
        lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
        Set rng = .Cells(4, 1).Resize(lastRow - 3)
        MsgBox "Nombre d'occurences : " & WorksheetFunction.CountIf(rng, TextBox1.Value), 64, TextBox1.Value
    End With
End Sub
Rechercher des sujets similaires à "compter nombre occurrence textbox colone"