Pivot dropdowns do not refresh when all data is replaced

dhasler

New Member
Joined
Jan 21, 2004
Messages
5
Hello,

I have a spreadsheet containing over 20 pivot tables. I would like to replace the entire data set with all new data in exactly the same format with the same column names. When I do this and refresh my tables, the data fields in my pivot tables calculate correctly but the names in the drop down pivot table menus contain the data names from both the old and new data sets. Is there a way to see only the new data names?

Thank you in advance for your help!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
The esiest way to clear out the old data is via, macro.

Heres the macro for excel 2002 onwards - not written by me I might add.

There is a d ifferent version for pre excel 2002

Sub DeleteMissingItems2002All()
'prevents unused items in non-OLAP PivotTables

'in Excel 2002 and later versions
'If unused items already exist,
'run this macro then refresh the table
Dim pt As PivotTable
Dim ws As Worksheet

For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone
pt.PivotCache.Refresh
Next pt
Next ws

End Sub
 
Upvote 0

Forum statistics

Threads
1,211,803
Messages
6,104,067
Members
447,892
Latest member
madara uchiha

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