Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Pivot Table Question
Set AutoSort to manual, and you'll be able to set visible to True.
With ActiveSheet.PivotTables _ ("PivotTable1").PivotFields("Org") .AutoSort xlManual, "Org" .PivotItems("Item Name").Visible = True End With Jack Clifford wrote: 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 -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot table question. | Excel Discussion (Misc queries) | |||
Pivot Table question | Charts and Charting in Excel | |||
Pivot Table Question | New Users to Excel | |||
pivot table question | Excel Worksheet Functions | |||
Pivot Table Question : If statment in Pivot Table?? | Excel Discussion (Misc queries) |