If I create a Pivot Table with 3 sets of row items but hide all but 2 of the top level pivot items, the visible property of the 3rd level items doesn't seem to be affected.
e.g. This shows the name and summary at level 1
However, this doesn't show the corresponding name and summary at level 3 (as shown on screen).Code:For Each pi In pt.RowFields(1).PivotItems If pi.Visible = True Then Debug.Print pi.Name Debug.Print pi.DataRange End If Next
It shows everything at level 3 regardless of whether it is hidden by level 1 or not.
Code:For Each pi In pt.RowFields(3).PivotItems If pi.Visible = True Then Debug.Print pi.Name Debug.Print pi.DataRange End If Next
How can I loop over the pivot table just getting the displayed info at level 3?


Reply With Quote