Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pivot Table Column Field showing items not in my source data? 2

Status
Not open for further replies.

arby123

Programmer
Jan 20, 2004
1
0
0
GB
Hi, hope someone can help. I've an Excel pivot table/chart, the source data is amended daily, and historically the values in one column were different. They've now changed, I've refreshed the pivot - but in the drop down field for this column it still lists all the old values (as well as the new ones). I don't want to have to keep re-creating a pivot table each time the source data changes.

Any ideas?

Richard.
 
This is do do with the pivotCACHE retaining older values

Run the following code ONCE only with the sheet that contains the pivottable active
Code:
Sub CleanPivotData()
activesheet.pivottables(1).pivotcache.missingitemslimit = xlmissingitemsnone
end sub
to get more info, type
missingitemslimit
into the VBA help search engine

Rgds, Geoff
[blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
 
A quick but dirty way...

rename the offending field in the source data

I.E.

field name: date received to date_received

refresh the pivot

change the name back to the original

refresh the pivot

 
Hi XLBO...

Does this work with all versions of excel?
 
Only those that have a pivotcache I believe - should work fine on 2000/XP - not sure about 97 'cos by the time I learned about it, we had moved to XP ;-)

Rgds, Geoff
[blue]Experience is something you don't get until just after you need it[/blue]
We want to help [red]you[/red] Help us by reading this FAQ 1st faq222-2244
 
ETID -

Have searched all over web and tek-tips and found your suggestion to work perfectly! Your suggestion saved me having to recreate six different pivot tables and charts!

Thanks!!

[thumbsup]
 
kdaffy - if you have 2000 or higher, you should really use the missingitemslimit as it would mean not having to change the field name every time...

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
XLBO,

I am curious,...about this line in your response.

"Run the following code ONCE only with the sheet that contains the pivottable active"

Will rotten things happen if this is run more than once or is it just redundant?

thanks
 
It's just redundant - once the limit has been set, it stays that way - there is no harm in running it again but it's kinda pointless ;-)

Rgds, Geoff

Never test the depth of water with both feet

Help us to help you by reading FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top