Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA Pivot Table: Add Filter

Using VBA code, I have created a Pivot table and then added row, columns and then the summation values. Now I need to add a filter on a column. Can you please let me know how can I add filters to this column.

like image 616
meru Avatar asked Dec 06 '25 20:12

meru


1 Answers

Try the following code:

Sub Makró2()
    With ActiveSheet.PivotTables("Kimutatás1").PivotFields("a")
        .PivotItems("asd").Visible = False
        .PivotItems("hj").Visible = False
    End With
End Sub

For example:

enter image description here

like image 172
Zsmaster Avatar answered Dec 08 '25 11:12

Zsmaster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!