I have tries to record a macro to select all data from a filter in a pivot table except one - however the macro recorder is too specific to the data I am currently using which is no good as the data changes daily.
This is what it creates:
Sub pivot()
'
' pivot Macro
'
'
Sheets("PIVOT").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("Description").CurrentPage _
= "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Description")
.PivotItems("ORDERED 16/09/2022").Visible = True
.PivotItems("ORDERED 23/09/2022").Visible = True
.PivotItems("ORDERED 22/09/2022").Visible = True
.PivotItems("ORDERED 28/09/2022").Visible = True
.PivotItems("ORDERED 13/09/2022").Visible = True
.PivotItems("ORDERED 29/09/2022").Visible = True
.PivotItems("ORDERED 26/09/2022").Visible = True
.PivotItems("ORDERED 27/09/2022").Visible = True
End With
End Sub
How can I change this so all data is displayed apart from SALVAGE?
When I recorded the macro I selected ALL and then deselected SALVAGE however the macro I have created lists the items on display which change as they are dates!
I have to admit I am not great with macros and rely heavily on the recorder, which normally works but not this time.
Any help would be greatly appreciated.
Sara
This is what it creates:
Sub pivot()
'
' pivot Macro
'
'
Sheets("PIVOT").Select
ActiveSheet.PivotTables("PivotTable2").PivotFields("Description").CurrentPage _
= "(All)"
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Description")
.PivotItems("ORDERED 16/09/2022").Visible = True
.PivotItems("ORDERED 23/09/2022").Visible = True
.PivotItems("ORDERED 22/09/2022").Visible = True
.PivotItems("ORDERED 28/09/2022").Visible = True
.PivotItems("ORDERED 13/09/2022").Visible = True
.PivotItems("ORDERED 29/09/2022").Visible = True
.PivotItems("ORDERED 26/09/2022").Visible = True
.PivotItems("ORDERED 27/09/2022").Visible = True
End With
End Sub
How can I change this so all data is displayed apart from SALVAGE?
When I recorded the macro I selected ALL and then deselected SALVAGE however the macro I have created lists the items on display which change as they are dates!
I have to admit I am not great with macros and rely heavily on the recorder, which normally works but not this time.
Any help would be greatly appreciated.
Sara