Hi,
I'm trying to write a part within a macro which will filter down a Pivot Table to show 4 or 5 choices particular to the user from a list of around 30.
When i've recorded this it shows it the opposite way as below, ie. visible = false, i've tried doing it the opposite way and put visible=true unfortunately this didn't work.
To add to the conundrum, the list won't always be exhaustive, so i may want David Broad to show, how can i make i work if he's not in the list??
Any ideas would be appreciated. Thanks
I'm trying to write a part within a macro which will filter down a Pivot Table to show 4 or 5 choices particular to the user from a list of around 30.
When i've recorded this it shows it the opposite way as below, ie. visible = false, i've tried doing it the opposite way and put visible=true unfortunately this didn't work.
To add to the conundrum, the list won't always be exhaustive, so i may want David Broad to show, how can i make i work if he's not in the list??
Any ideas would be appreciated. Thanks
Code:
Sub Macro18()
'
' Macro18 Macro
'
'
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Surveyor")
.PivotItems("Adam Baker").Visible = False
.PivotItems("Alexandra Beeching").Visible = False
.PivotItems("Dominic Jay").Visible = False
.PivotItems("Gary Sumpter").Visible = False
.PivotItems("Gary Waring").Visible = False
End With
End Sub