Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default clearing pivot table field values

I have a pivot table that I use for several different departments. The pivot table is linked to an access query that I often simply change the criteria in to switch from one department to the next. When I refresh the pivot table...tada... same pivot table, graphs, summaries, etc but with the new client.

one problem, if you go into the field settings, you see all of the previously refreshed data points. i.e. if I create the pivot table and include employee names, when I refresh the table with a new department, it still shows the old names under the field settings.

any "easy" way of clearing this without completely re creaing the pivot table each time?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default clearing pivot table field values



"graham" wrote:

I have a pivot table that I use for several different departments. The pivot table is linked to an access query that I often simply change the criteria in to switch from one department to the next. When I refresh the pivot table...tada... same pivot table, graphs, summaries, etc but with the new client.

one problem, if you go into the field settings, you see all of the previously refreshed data points. i.e. if I create the pivot table and include employee names, when I refresh the table with a new department, it still shows the old names under the field settings.

any "easy" way of clearing this without completely re creaing the pivot table each time?

Graham,

Try this: it's from Debra Dalgliesh's site www.contextures.com

Public Sub DeleteOldItemsFromPivot()
'From Web: mailto:
'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 Long
On Error Resume Next
Sheets(P1Sheet).Unprotect Password:="haifa"
With CSRPivot1
For Each pf In .PivotFields
For Each pi In pf.PivotItems
If pi.RecordCount = 0 And _
Not pi.IsCalculated Then
pi.Delete
End If
Next
Next
End With
NewCSRPivot.ProtectAndEnable
End Sub

Regards
Ian
Reply
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
Missing values from a pivot table field Kelli[_2_] Excel Worksheet Functions 1 April 27th 10 07:44 PM
Pivot table not recognizing same field values neilmber Excel Discussion (Misc queries) 1 May 8th 08 01:19 AM
Pivot Table Field Values not sorted pepperds Excel Discussion (Misc queries) 1 February 16th 07 08:16 PM
Selection of multiple values for pivot table field Michael Glenn Excel Discussion (Misc queries) 0 February 23rd 06 02:11 PM
Fill a Listbox with Values from a Pivot Table Field - an Example DataFreakFromUtah Excel Programming 0 February 12th 04 04:12 PM


All times are GMT +1. The time now is 11:04 PM.

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

About Us

"It's about Microsoft Excel"