View Single Post
 
Old 02-03-2014, 11:59 AM
galkej galkej is offline Windows 8 Office 2013
Novice
 
Join Date: Feb 2014
Posts: 3
galkej is on a distinguished road
Default Excel Macro to "Select All" in Pivot Table Field

I have the code below to "turn off" certain values of a field in a Pivot Table, but how do I accomplish this if I want to "turn on" all values in a field of a Pivot Table?

Thanks

Dim pi_2 As PivotItem
With ActiveSheet.PivotTables("PivotTable3").PivotFields ("Order")
For Each pi_2 In .PivotItems
If pi_2.Caption = "(blank)" And pi_2.Visible = True Then
pi_2.Visible = False
Exit For
End If
Next
End With
Dim pi_3 As PivotItem
With ActiveSheet.PivotTables("PivotTable3").PivotFields ("Order")
For Each pi_3 In .PivotItems
If pi_3.Caption = "#N/A" And pi_3.Visible = True Then
pi_3.Visible = False
Exit For
End If
Next
End With
Reply With Quote