View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jack Clifford Jack Clifford is offline
external usenet poster
 
Posts: 1
Default VBA Pivot Table Question

I have a pivot table and some pivot items are hidden. When
I want to display them using VB code it fails.

I tried both the following statements neither works. Both
statements work to hide the pivot when visible = True.

Any suggestions?

These Work (the selected Pivot Item is hidden)

Worksheets("Summary").PivotTables(1).PivotFields(" Org") _
.PivotItems("Item Name").Visible = False

With ActiveSheet.PivotTables _
("PivotTable1").PivotFields("Org")
.PivotItems("Item Name").Visible = False
End With


These Fail (The selected pivot item is not displayed)

Worksheets("Summary").PivotTables(1).PivotFields(" Org") _
.PivotItems("Item Name").Visible = True

With ActiveSheet.PivotTables _
("PivotTable1").PivotFields("Org")
.PivotItems("Item Name").Visible = True
End With