PivotTable-Fields Page

G

Guest

Hi,
I have a problem with the ListBox Page Fields in a pivotTable.
This Fields in ListBox aren't updated. The code is:
Set pvtTable = Worksheets("Ordini").Range("A9").PivotTable
If pvtTable.RefreshTable = False Then MsgBox "Not Updated Pivot
Table"
pvtTable.PivotCache.OptimizeCache = True
pvtTable.Update


Example:

Fields : A | B | C
Data: 1 xx xx
" 2 xx xx
" 3 xx xx

In the listbox, when i Click the arrow near the Field "A" there are this
data: All, 1 , 2 , 3 with the flag.

now i delete the row 2 from the data,Update the PivotTable and i click the
field "A" and i find the same data:All, 1 , 2 , 3 with the flag. Why ?
The Pivot table remember also the data that aren't or not update.

Thanks
 
T

Tom Ogilvy

My understanding is this is by design. Since at least at some point, 2 was
a valid value, it is retained in the drop down. when you select it, no data
is displayed, but this does not meant that 2 is not a possible legal value.

Debra Dalgleish has code for removing the items:

http://www.contextures.com/xlPivot04.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top