Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH

I have created a pivot table in which I am frequently
adding and deleting information from the pivot data
source. After refreshing the table, the updates are
reflected. HOWEVER, if the field I am working with is
part of the LAYOUT area (Row or column) and I choose to
select only some of the data from the field, it shows a
list of all data that has ever been a part of the data.
So, even though for example, I deleted the name Jon Doe
from my pivot data source field called 'Names', it remains
one of the 'Names' that I can choose to display. Of
course, if I do choose Jon Doe, the name is not shown in
the report and no data for him is shown either.
Ironically, if I Pivot Drag the field to the PAGE area, my
choices are '(All)' or any of the names that have data.
Jon Doe will not even be a choice.

IS THERE A WAY TO REVISE THIS? IN OTHER WORDS, I WOULD
LIKE IT IF WHEN I HIT REFRESH THAT THE CHOICES FOR 'NAMES'
FROM THE LAYOUT AREA DOES NOT REFLECT NAMES THAT HAVE
SINCE BEEN REMOVED FROM MY PIVOT DATA. CAN THIS BEEN
DONE? HOW?

Please help!

Ken Roberts
617 951 7494
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH

Previously posted 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
"Ken Roberts" wrote in message
...
I have created a pivot table in which I am frequently
adding and deleting information from the pivot data
source. After refreshing the table, the updates are
reflected. HOWEVER, if the field I am working with is
part of the LAYOUT area (Row or column) and I choose to
select only some of the data from the field, it shows a
list of all data that has ever been a part of the data.
So, even though for example, I deleted the name Jon Doe
from my pivot data source field called 'Names', it remains
one of the 'Names' that I can choose to display. Of
course, if I do choose Jon Doe, the name is not shown in
the report and no data for him is shown either.
Ironically, if I Pivot Drag the field to the PAGE area, my
choices are '(All)' or any of the names that have data.
Jon Doe will not even be a choice.

IS THERE A WAY TO REVISE THIS? IN OTHER WORDS, I WOULD
LIKE IT IF WHEN I HIT REFRESH THAT THE CHOICES FOR 'NAMES'
FROM THE LAYOUT AREA DOES NOT REFLECT NAMES THAT HAVE
SINCE BEEN REMOVED FROM MY PIVOT DATA. CAN THIS BEEN
DONE? HOW?

Please help!

Ken Roberts
617 951 7494



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH

Tom:

I consider myself an advanced user but I have no idea how
to implement your suggestion. Furthermore, will this
automatically do this for all of my existing files with
pivots or do I have to do it every time I open the file?

Please let me know the next 'easy' steps.

- Ken Roberts


-----Original Message-----
Previously posted 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
"Ken Roberts" wrote in message
...
I have created a pivot table in which I am frequently
adding and deleting information from the pivot data
source. After refreshing the table, the updates are
reflected. HOWEVER, if the field I am working with is
part of the LAYOUT area (Row or column) and I choose to
select only some of the data from the field, it shows a
list of all data that has ever been a part of the data.
So, even though for example, I deleted the name Jon Doe
from my pivot data source field called 'Names', it

remains
one of the 'Names' that I can choose to display. Of
course, if I do choose Jon Doe, the name is not shown in
the report and no data for him is shown either.
Ironically, if I Pivot Drag the field to the PAGE area,

my
choices are '(All)' or any of the names that have data.
Jon Doe will not even be a choice.

IS THERE A WAY TO REVISE THIS? IN OTHER WORDS, I WOULD
LIKE IT IF WHEN I HIT REFRESH THAT THE CHOICES

FOR 'NAMES'
FROM THE LAYOUT AREA DOES NOT REFLECT NAMES THAT HAVE
SINCE BEEN REMOVED FROM MY PIVOT DATA. CAN THIS BEEN
DONE? HOW?

Please help!

Ken Roberts
617 951 7494



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH

You put the code in a general module in the VBE.

You have to actively run it (Tools=Macros). As written, it runs against
all pivot tables in a specific workbook. Run it when you need it.

Not sure why you are posting the question in programming if you don't know
anything about programming? (although in xl2000 and earlier, I don't think
there are other options).

--
Regards,
Tom Ogilvy


Ken Roberts wrote in message
...
Tom:

I consider myself an advanced user but I have no idea how
to implement your suggestion. Furthermore, will this
automatically do this for all of my existing files with
pivots or do I have to do it every time I open the file?

Please let me know the next 'easy' steps.

- Ken Roberts


-----Original Message-----
Previously posted 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
"Ken Roberts" wrote in message
...
I have created a pivot table in which I am frequently
adding and deleting information from the pivot data
source. After refreshing the table, the updates are
reflected. HOWEVER, if the field I am working with is
part of the LAYOUT area (Row or column) and I choose to
select only some of the data from the field, it shows a
list of all data that has ever been a part of the data.
So, even though for example, I deleted the name Jon Doe
from my pivot data source field called 'Names', it

remains
one of the 'Names' that I can choose to display. Of
course, if I do choose Jon Doe, the name is not shown in
the report and no data for him is shown either.
Ironically, if I Pivot Drag the field to the PAGE area,

my
choices are '(All)' or any of the names that have data.
Jon Doe will not even be a choice.

IS THERE A WAY TO REVISE THIS? IN OTHER WORDS, I WOULD
LIKE IT IF WHEN I HIT REFRESH THAT THE CHOICES

FOR 'NAMES'
FROM THE LAYOUT AREA DOES NOT REFLECT NAMES THAT HAVE
SINCE BEEN REMOVED FROM MY PIVOT DATA. CAN THIS BEEN
DONE? HOW?

Please help!

Ken Roberts
617 951 7494



.



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
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
refresh a new worsheet on pivot table refresh [email protected] Excel Worksheet Functions 0 February 9th 07 07:39 PM
Refresh Data Pivot Table Annabel Excel Discussion (Misc queries) 0 October 3rd 06 09:00 AM
How do I refresh the selection listboxes on a pivot table? WWW.CS Excel Discussion (Misc queries) 2 February 23rd 05 11:33 AM
Pivot Table Data Refresh patemarie Excel Discussion (Misc queries) 1 December 1st 04 04:35 PM


All times are GMT +1. The time now is 11:11 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"