Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default PivotItems Bug?!

If I have a simple data table like:

NAME AGE
A 10
B 20

If I then create a pivottable, named myTable, that looks into the
above, which has the Name field up above the pivottable as a dropdown.
If I then run the following:

MsgBox
ThisWorkbook.ActiveSheet.PivotTables("myTable").Pi votFields("Name").PivotItems.Count

....it will return 3, representing A,B and All.
If I then change the table to :

NAME AGE
A 10
B 20
C 30
D 40

....the message box will return 5, representing A,B,C,D and All.
The problem occurs when I change the data table to:

NAME AGE
A 10
X 20

....the message box now returns 6, which I believe must represent A, B,
C, D, X and All. Surely this is a bug as the items B, C, and D should
not be included !!

Any comments or ways of avoiding this would be much appreciated.
Regards
Jason.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default PivotItems Bug?!

I'm not sure, but maybe you need to adjust the pivot table's range.

Regards,
Steve
www.swiss-ins.com

WhytheQ wrote:
If I have a simple data table like:

NAME AGE
A 10
B 20

If I then create a pivottable, named myTable, that looks into the
above, which has the Name field up above the pivottable as a dropdown.
If I then run the following:

MsgBox
ThisWorkbook.ActiveSheet.PivotTables("myTable").Pi votFields("Name").PivotItems.Count

...it will return 3, representing A,B and All.
If I then change the table to :

NAME AGE
A 10
B 20
C 30
D 40

...the message box will return 5, representing A,B,C,D and All.
The problem occurs when I change the data table to:

NAME AGE
A 10
X 20

...the message box now returns 6, which I believe must represent A, B,
C, D, X and All. Surely this is a bug as the items B, C, and D should
not be included !!

Any comments or ways of avoiding this would be much appreciated.
Regards
Jason.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,886
Default PivotItems Bug?!

Hi

Take a look at the information on Debra Dalgleish's site regarding PT's
retaining old items.
Debra also shows some code there for "cleaning" the list
http://www.contextures.com/xlPivot04.html

--
Regards

Roger Govier


"WhytheQ" wrote in message
ps.com...
If I have a simple data table like:

NAME AGE
A 10
B 20

If I then create a pivottable, named myTable, that looks into the
above, which has the Name field up above the pivottable as a dropdown.
If I then run the following:

MsgBox
ThisWorkbook.ActiveSheet.PivotTables("myTable").Pi votFields("Name").PivotItems.Count

...it will return 3, representing A,B and All.
If I then change the table to :

NAME AGE
A 10
B 20
C 30
D 40

...the message box will return 5, representing A,B,C,D and All.
The problem occurs when I change the data table to:

NAME AGE
A 10
X 20

...the message box now returns 6, which I believe must represent A, B,
C, D, X and All. Surely this is a bug as the items B, C, and D should
not be included !!

Any comments or ways of avoiding this would be much appreciated.
Regards
Jason.



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
Controlling Pivotitems.visible sxhwabbiemike Excel Discussion (Misc queries) 0 January 21st 09 03:09 AM
Almost there... dynamic and conditional set of PivotItems s80NL[_8_] Excel Programming 3 July 17th 06 08:06 PM
Adding PivotItems Geoff Excel Programming 0 April 12th 06 09:10 AM
Always keep the same 4 PivotItems visible Martin[_21_] Excel Programming 2 April 27th 05 10:17 AM
Add PivotItems to PivotTable / Enabling - Disabling PivotItems Ole[_3_] Excel Programming 1 July 8th 03 03:24 PM


All times are GMT +1. The time now is 09:37 AM.

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"