|
Home > Pivot > Layout > Old Items Clear Old Items From Pivot Filter
|

If you remove data in a pivot table's source data, that data might still show up in the pivot table, even after you refresh it.
In my video below, a company restructured, but an old region name is stuck in the pivot table filter.

In the video, I show how to fix that problem, and there are written steps below. There is a full video transcript at the end of the page.
Video Timeline
To get the sample data and pivot table, used in the video, download this Pivot Table Old Items workbook. The zipped file is in xlsx format, and does not contain any macros.
To prevent old items from being retained in a pivot table, you can change an option setting:
Note: This setting is available in PivotTable Options in Excel 2007 and later. For Excel 2003, the setting can be changed with a macro.

To stop old items from being appearing in new pivot tables, you can change a pivot table default setting, in Excel 2019, or Excel for Office 365.
Later, when you create new pivot tables, those will automatically have the settings that you prefer.
Follow these steps to change the default settings.



If you don't want to change an option setting, you can manually clear the old items from the drop down lists.
To do that, follow the steps below:
If you have lots of pivot tables to change, you can save time, by using a macro to do the work for you.
The following macro will change the pivot table properties, to prevent missing items from appearing, or clear items that have appeared.
This macro changes the MissingItemsLimit setting for all pivot tables in the active workbook.
Sub DeleteMissingItemsAllPTs()
'For NEW versions of Excel
'developed by contextures.com
'to prevent unused items in
' non-OLAP PivotTables
' changes MissingItemsLimit setting
' for all PTs in active workbook
Dim pt As PivotTable
Dim wb As Workbook
Dim ws As Worksheet
Dim pc As PivotCache
Set wb = ActiveWorkbook
'change the settings
For Each ws In wb.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit _
= xlMissingItemsNone
Next pt
Next ws
'refresh all the pivot caches
For Each pc In wb.PivotCaches
On Error Resume Next
pc.Refresh
Next pc
End Sub
To prevent old items from being retained in new pivot tables, you can use these macros to change a pivot table default setting, in Excel 2019, or Excel for Office 365.
This macro changes the setting to None, so old items will not appear in new pivot tables.
Sub DefaultMissingItemsNone() 'For Excel 365 or Excel 2019 'Default setting =None 'developed by contextures.com 'change default setting for ' MissingItemsLimit setting ' for all new PTs Application _ .DefaultPivotTableLayoutOptions _ .xlMissingItemsNone = 0 End Sub
This macro changes the setting to Automatic, so old items will appear in new pivot tables
Sub DefaultMissingItemsAuto() 'For Excel 365 or Excel 2019 'Default setting =Automatic 'developed by contextures.com 'change default setting for ' MissingItemsLimit setting ' for all new PTs Application _ .DefaultPivotTableLayoutOptions _ .xlMissingItemsNone = -1 End Sub
No Macros: To see the sample data and pivot table, used in these examples, download the Pivot Table Old Items NO macro workbook. The zipped file is in xlsx format, and does not contain any macros.
Macros: To see the sample data, pivot table, and macros, used in these examples, download the Pivot Table Old Items macro workbook. The zipped file is in xlsm format, and contains the macros from this page. To test the macros, be sure to enable macros, if prompted, when you unzip and open the workbook.
Don't miss my monthly Excel newsletter! You'll get quick tips, article links, and a bit of fun. Add your email, and click Sign Up.
Next, when you get my reply, click the Confirm button. I add this step to protect you from spam!
Here is the full transcript for the Old Items in Pivot Filters video above.
In this video, we'll see why old items remain in your pivot table drop-downs sometimes, how you can fix it, and how you can keep it from happening in the future.
This is Debra Dalgleish from Contextures.com.
in this pivot table we've got sales data for three different regions over two years and we'll see how old items can get stuck in the dropdowns such as this region one which currently shows Central, East and West.
You can also see Central, East and West in the column headings.
This pivot table is based on this sales data and if I look at the region column here, the same three regions appear.
Now we're going to be combining East and Central under the name East, so I'll show only the Central and I'll change all of those to East.
Now if I look at the dropdown, only East and West are appearing in this table. I'll clear that filter and go back to my pivot table.
We haven't refreshed this yet, so I'll right-click on a cell and click refresh and now we only have East and West here, but if I click the region dropdown, I can still see Central, even though it's been removed from the data and I've refreshed the pivot table.
So we'll look at how to fix that to make that old item disappear, from this dropdown.
To clear the old items from this pivot table, I'm going to change a pivot table option setting and that will get rid of the old item for regions and it will prevent any other old items from appearing, if I remove other data from the source data table.
To show pivot table options, right-click on a cell in the pivot table; click pivot table options. In here we're going to the data tab.
There's a section 'retain items deleted from the data source.' The item here is number of items to retain per field and the default, if you haven't changed it, is automatic.
So that will keep old items and we don't want that. We want none. Now when I click okay, I'll still be able to see Central, but if I refresh now and look again, we can only see East and West.
So that old item was cleared from our data. So that change to the pivot table options will affect this selected pivot table and any others that are based on that same pivot cache as this one.
So you can use those steps to change an individual pivot table. But if you make lots of pivot tables and you would prefer to have that none as your default setting, you can change that if you're using Excel for Office 365 or Excel 2019.
To do that, go into the File tab and click Options, and then on the Data tab right near the top, you've got Data options → Make changes to the default layout of PivotTables.
Click the button that says Edit Default Layout, and in here you can see a few settings that you can change, but we're going into PivotTable Options and this looks just like the regular PivotTable Options window.
So go to Data, and right now it's set to use automatic as the setting, but if you want most of your pivot tables to retain none of the old items, select that; click okay, and you're back here and you can make any other changes you'd like.
When you're done, click okay, and click okay again, and now your default setting for any new pivot table will have None as your old items setting.
Thanks for watching this video. You can go to my website, Contextures.com to get this workbook, and please subscribe to my Contextures YouTube channel so you can see the latest videos as I post them.
Last updated: March 21, 2025 3:51 PM