Refresh Pivot Table and Reapply Filter

TheRedCardinal

Active Member
Joined
Jul 11, 2019
Messages
252
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I have a very basic sub that refreshes 6 pivot tables on a sheet:

VBA Code:
Sub RefreshPivots()

Dim WS1 As Worksheet, WBk1 As Workbook, PT As PivotTable

Set WBk1 = ThisWorkbook
Set WS1 = WBk1.Sheets("9 - Purchase Pivot Checks")

For Each PT In WS1.PivotTables

    PT.RefreshTable
        
Next PT

End Sub

The refresh is needed because the data source (in all cases, the same table) gets bigger each month. It also includes some new variants in a column that is used as a filter.

The filter is set to exclude a single item, "Not Present" from the column "Issued" but once the refresh happens, any new items in the Issued column are also filtered out.

I am not sure how to reset the filters so everything is visible except for this single item.

Could anybody help?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top