Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cgbosse/821002275aeded03f4553d72356e4978 to your computer and use it in GitHub Desktop.
Save cgbosse/821002275aeded03f4553d72356e4978 to your computer and use it in GitHub Desktop.
Excel - Macro - Pivot Tables - Manipulating - Refreshing, clearing filters and hiding "blanks"
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
@cgbosse
Copy link
Author

cgbosse commented Apr 15, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment