PDA

View Full Version : Deselecting a single pivot table item which is referenced in a specific cell



JPCoon22
07-29-2013, 06:52 AM
Good Morning All, I am trying to write a code that will allow me to deselect a single pivot table item from a referenced cell and am having a bit of trouble. Below is the code that I am trying to use. The " .PivotItem.CurrentPage = Range("AG4").Text.Visible = False" section is the area which seems to be causing the error and I don’t know how to correct it. When hard coded as Pivotitem(“whatever”).Visible = False; works fine I just need it to reference the item in the specific cell.ActiveSheet.PivotTables("PVT1").PivotFields("Client #").CurrentPage = Range("AG4").Text ActiveSheet.PivotTables("PVT2").PivotFields("Client #").CurrentPage = Range("AG4").Text ActiveWindow.SmallScroll Down:=23 ActiveSheet.PivotTables("PVT3").PivotFields("Client #").CurrentPage = "(All)" With ActiveSheet.PivotTables("PVT3").PivotFields("Client #") .PivotItem.CurrentPage = Range("AG4").Text.Visible = False End With ActiveSheet.PivotTables("PVT3").PivotFields("Client #"). _ EnableMultiplePageItems = True ActiveWindow.SmallScroll Down:=-82End SubAny help or advise received will greatly be appreciated!Thanks!