Pulldown on PivotField show PivotItems that are not in my data.

foverman

Board Regular
Joined
Sep 2, 2008
Messages
139
Question

When I look at the PivotItems available for a given PivotField in Excel 2003, I see items that are not in my data. Seems like this has always been the case, but I don't seem to be able to come up with the right query to find anything on it. Is there a way to prevent this?

Details

The PivotTable is convinced that there is data for 2006-Q1, 2008-Q1-4, and 2009-Q1-Q3. But when I look at my data, there's nothing before 2009.


Here's a shot of my PivotTable:


And here's a shot of the AutoFilter on my data (after doing a show all, so no other filters are applied):




Whether Excel is delusional or has too good of a memory, I'm not sure, but how do I get it to forget about 2008 and earlier?

Google "search terms" site:mrexcel.com is my frequent lifeline!
Everyone on this fine site have contributed immeasurably to my Excel and VBA knowledge.

Thank you Greg Truby and schielrn for How To Post Thumbnails and Pictures.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
It sounds like you probably had data for those time periods at one point in your pivot, and it was later deleted out, but they are still showing up in the pivot. Running this code should clear out the pivot cache and take anything out of the dropdowns that is no longer in your dataset.

Code:
Sub DeleteMissingItems()

Dim pt As PivotTable
Dim ws As Worksheet
Dim pc As PivotCache

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

For Each pc In ActiveWorkbook.PivotCaches
  On Error Resume Next
  pc.Refresh
Next pc

End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,889
Messages
6,181,606
Members
453,055
Latest member
cope7895

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