LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Updating Pivot Tables

From a previous post by Debra Dalgleish

Message-ID:
Date: Fri, 22 Aug 2003 17:54:18 -0400
From: Debra Dalgleish
Subject: Pivot table filter list doesn't refresh
Newsgroups: microsoft.public.excel.programming



To eliminate the old items from the dropdowns, in Excel 2002, you can
set the MissingItemsLimit property:

'==========================
Sub DeleteMissingItems2002()
'prevents unused items in XL 2002 PivotTable
Dim pt As PivotTable

Set pt = ActiveSheet.PivotTables.Item(1)
pt.PivotCache.MissingItemsLimit = xlMissingItemsNone

End Sub
'=============================

For earlier versions, you can run the following macro:
'======================
Sub DeleteOldItemsWB()
'gets rid of unused items in PivotTable
' based on MSKB (202232)
Dim ws As Worksheet
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim i As Integer

On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
For Each pt In ws.PivotTables
pt.RefreshTable
For Each pf In pt.VisibleFields
For Each pi In pf.PivotItems
If pi.RecordCount = 0 And _
Not pi.IsCalculated Then
pi.Delete
End If
Next
Next
Next
Next
End Sub
'================================

--
Regards,
Tom Ogilvy


"Steven Revell" wrote in message
...
Hi All,

I was wondering how to update a pivot table so that any
deleted data does not appear. The refresh command will add
any data not already in the table but it doesn't remove
data.

Any ideas?

Thanks,
Steven



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Updating Pivot Tables Chally72 Excel Discussion (Misc queries) 3 October 15th 09 05:25 PM
Updating Pivot Tables Ian Briffett Excel Discussion (Misc queries) 0 May 21st 08 08:18 PM
Updating all pivot tables at once rascal Excel Worksheet Functions 1 March 28th 07 01:44 AM
updating pivot tables ILoveAmerica!!! Excel Discussion (Misc queries) 0 October 11th 06 07:19 PM
updating pivot tables jgibbings Excel Discussion (Misc queries) 3 May 9th 05 11:02 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"