View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
WhytheQ WhytheQ is offline
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.