
Originally Posted by
nailler167
Hi all,
I wanted to see if anyone can help with vba code on pivot tables
I have a report Filter on my Pivot table. The macro that I have sets the Pivot filter to the date that I have entered in Cell "C3".
Does anyone know how I can adapt the below code to update all pivot tables in my workbook without naming each individual Pivot table.
Sub aab()
Dim pi As PivotItem
Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date").ClearAllFilters
With Worksheets("Jar").PivotTables("PivotTable38").PivotFields("Business_date")
For Each pi In .PivotItems
pi.Visible = WorksheetFunction.CountIf(Worksheets("Report_Creator").Range("c3"), pi.Name) > 0
Next pi
End With
End Sub
It seems that what I am trying to do is not possible does anyone have an alternate solution ask
I would be very grateful for any input.
Thanks in advance
Bookmarks