B
Barb Reinhardt
I'm trying to identify a hidden Pivot table page field. I've looked at the
..hiddenitems and the .visibleitems properties, but it appears that there is
always one .VisibleItem and the remainder are hidden. If I double click on
the page name, I can hide a field there. How do I find that name
programmatically?
I'm trying something like this
Sub FindHidden()
Dim myPivotTable As PivotTable
Dim myPageField As PivotField
Dim myHiddenItem As PivotItem
Dim myVisibleItem As PivotItem
For Each myPivotTable In ActiveSheet.PivotTables
For Each myPageField In myPivotTable.PageFields
For Each myHiddenItem In myPageField.HiddenItems
Debug.Print "Hidden", myPageField.Name, myHiddenItem.Name
Next myHiddenItem
For Each myVisibleItem In myPageField.VisibleItems
Debug.Print "Visible", myPageField.Name, myVisibleItem.Name
Next myVisibleItem
Next myPageField
Next myPivotTable
End Sub
Thanks,
Barb Reinhardt
..hiddenitems and the .visibleitems properties, but it appears that there is
always one .VisibleItem and the remainder are hidden. If I double click on
the page name, I can hide a field there. How do I find that name
programmatically?
I'm trying something like this
Sub FindHidden()
Dim myPivotTable As PivotTable
Dim myPageField As PivotField
Dim myHiddenItem As PivotItem
Dim myVisibleItem As PivotItem
For Each myPivotTable In ActiveSheet.PivotTables
For Each myPageField In myPivotTable.PageFields
For Each myHiddenItem In myPageField.HiddenItems
Debug.Print "Hidden", myPageField.Name, myHiddenItem.Name
Next myHiddenItem
For Each myVisibleItem In myPageField.VisibleItems
Debug.Print "Visible", myPageField.Name, myVisibleItem.Name
Next myVisibleItem
Next myPageField
Next myPivotTable
End Sub
Thanks,
Barb Reinhardt