I am trying to work through the VBA syntax to check the Visible property of a group of PivotItems in a Page Field of a Pivot Table.
With the VBA code below I can accurately test the Visible property of a ROW field but testing the Visible property of the PAGE field returns FALSE in every instance. Whether an individual box is checked and displayed or if there are multiple selections checked.
The ultimate goal is to load all the Visible field names from the Page field into a test string that can be displayed in a cell. (AZ, TX, PA, etc&)
Any suggestions or
can someone verify that testing the Visible property of a Page field is not possible?
Thanks!
This code works great for Row fields but not for Page fields
Sub ChkPvtItems()
Dim pi As PivotItem
For Each pi In Worksheets("Report").PivotTables(1).PivotFields("City").PivotItems
If pi.Visible = True Then
MsgBox pi.Name & " is Visible"
Else
MsgBox pi.Name & " is NOT Visible"
End If
Next pi
End Sub
With the VBA code below I can accurately test the Visible property of a ROW field but testing the Visible property of the PAGE field returns FALSE in every instance. Whether an individual box is checked and displayed or if there are multiple selections checked.
The ultimate goal is to load all the Visible field names from the Page field into a test string that can be displayed in a cell. (AZ, TX, PA, etc&)
Any suggestions or
can someone verify that testing the Visible property of a Page field is not possible?
Thanks!
This code works great for Row fields but not for Page fields
Sub ChkPvtItems()
Dim pi As PivotItem
For Each pi In Worksheets("Report").PivotTables(1).PivotFields("City").PivotItems
If pi.Visible = True Then
MsgBox pi.Name & " is Visible"
Else
MsgBox pi.Name & " is NOT Visible"
End If
Next pi
End Sub