shadyshawn
New Member
- Joined
- Dec 28, 2010
- Messages
- 46
Hi guys. Not sure if anyone had the same issue before, but what I have is a pivot table and then I created few commend buttons so I can select different pivot items from the page field, instead of manually changing the field list each time. But I keep running into a weird issue:
say my button A has the following:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Service")
.PivotItems("1").Visible = True
.PivotItems("2").Visible = False
.PivotItems("3").Visible = False
And my button B has: the code:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Service")
.PivotItems("1").Visible = False
.PivotItems("2").Visible = False
.PivotItems("3").Visible = True
When I click on button A, the table is filtered properly showing only item "1", but then when click on button B after that, both item "1" and "3" are selected. What's even more puzzling is that after I click on button B again, it will then de-select "1" and select item "3" only. Any idea on why this might be happening?
say my button A has the following:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Service")
.PivotItems("1").Visible = True
.PivotItems("2").Visible = False
.PivotItems("3").Visible = False
And my button B has: the code:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Service")
.PivotItems("1").Visible = False
.PivotItems("2").Visible = False
.PivotItems("3").Visible = True
When I click on button A, the table is filtered properly showing only item "1", but then when click on button B after that, both item "1" and "3" are selected. What's even more puzzling is that after I click on button B again, it will then de-select "1" and select item "3" only. Any idea on why this might be happening?