Filtres et boutons

Bonjour,

Je souhaite avoir un filtre avec plusieurs crières et accès direct à ces critères via des boutons.

Ci joint un exemple plus explicite.

Merci pour votre aide

11exemple.xlsx (14.98 Ko)

Salut Jules,

plus habitué aux contrôles ActiveX, j'ai remplacé tes boutons et ajouté un 3e pour tout afficher.

For x = 19 To 9 Step -1
    Rows(x).EntireRow.Hidden = IIf(Cells(x, 1) = sData Or iFlag = 3, False, True)
    Columns(x - 5).EntireColumn.Hidden = IIf(Cells(4, x - 5) = sData Or iFlag = 3, False, True)
Next

A+

1hiddenmetz.xlsm (26.38 Ko)

Bonjour,

Une piste en conservant tes bouton Formulaire et en rajoutant un bouton "Afficher tout" :

Sub Filtre()

    Dim S As Shape
    Dim PlgLig As Range
    Dim PlgCol As Range
    Dim I As Integer

    With ActiveSheet

        Set PlgLig = .Range(.Cells(8, 1), .Cells(19, 1))
        Set PlgCol = .Range(.Cells(4, 4), .Cells(4, 14))
        Set S = .Shapes(Application.Caller)

    End With

    Application.ScreenUpdating = False

    PlgLig.AutoFilter
    PlgCol.EntireColumn.Hidden = False

    If S.TextFrame.Characters.Text = "Afficher tout" Then Exit Sub

    PlgLig.AutoFilter 1, S.TextFrame.Characters.Text

    For I = 1 To PlgCol.Count
        If PlgCol(I).Value <> S.TextFrame.Characters.Text Then PlgCol(I).EntireColumn.Hidden = True
    Next I

    Application.ScreenUpdating = True

End Sub
12exemple.xlsm (20.55 Ko)
Rechercher des sujets similaires à "filtres boutons"