VBA PivotTable Refresh seems to leave old data behind

VenturSum

Board Regular
Joined
May 23, 2010
Messages
137
Team,

The source data for a pivot table was recently updated.
The "Month" field previously showed: Oct, Nov & Dec
Now the "Month" field shows only: Jan

In the pivot table, when I click on the "Month"
and go to the Filter List, Oct, Nov & Dec are still there!!

The data items: Oct, Nov & Dec
do not appear in the Field: Month

Yet they still appear in the filter list.

Why is this?
How can I make these items disappear / removed?

John,
In Annapolis.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Right-click on any cell in your Pivot Table and select from the pop-up menu Refresh Data
 
Upvote 0
xenou,

The programmatic method lower on the page was just what I was looking to find.

Thank you,
John,
In Annapolis, MD
 
Upvote 0
Xenou / anyone,

Please see your Contexture's link in the above post
and scroll down to the vba example.

Any thoughts of running the below code first as opposed to last?

I ask because I'd like to add pt.Update to the top section.
or does the below code do the same as pt.Update?


Code:
    '-- refresh all the pivot caches
    For Each pc In ActiveWorkbook.PivotCaches
        On Error Resume Next
        pc.Refresh
    Next pc
any thoughts?

John,
In Annapolis.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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