Last active
April 15, 2021 12:36
-
-
Save cgbosse/821002275aeded03f4553d72356e4978 to your computer and use it in GitHub Desktop.
Excel - Macro - Pivot Tables - Manipulating - Refreshing, clearing filters and hiding "blanks"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub list_refresh() | |
' | |
' list_refresh Macro | |
' Refreshes the two Pivot Table lists for the Project Details | |
' | |
' | |
Dim pf As PivotField | |
Set pf = Worksheets("PIVOT").PivotTables("PivotTable1").PivotFields("Task") | |
pf.ClearAllFilters | |
pf.PivotItems("(blank)").Visible = False | |
Set pf = Worksheets("PIVOT").PivotTables("PivotTable2").PivotFields("User") | |
pf.ClearAllFilters | |
pf.PivotItems("(blank)").Visible = False | |
End Sub | |
------------------------- | |
Interesting links: | |
------------------------- | |
https://stackoverflow.com/questions/23793680/how-to-select-all-in-a-pivot-table-filter | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had to tables on this sheet and had to refresh them each time to include the new elements that showed up in the pivot fields.