sanantonio
Board Regular
- Joined
- Oct 26, 2021
- Messages
- 124
- Office Version
- 365
- Platform
- Windows
Howdy, sorry to queries in one day...
I did all of this using the macro record function. The issue I'm having is with the final filter. The entries into this will change all the time, apart from the default error message "PO has already been rolled today. Please reach out if you cannot find the associated PO."
I need that last filter to always filter OUT anything with this statement, regardless of whatever else might appear in the filter.
I thought putting <> between the open " and the first word did this but it doesn't seem to work. Currently when I run the macro it happily filters everything else and leaves this one untouched.
Thanks in advance for any help!
VBA Code:
Sub filter2()
'
' filter2 Macro
'
'
Sheets("Sheet 1").Select
On Error Resume Next
ActiveSheet.PivotTables("PivPOLevel").PivotSelect "Transfer[All]", xlLabelOnly _
, True
On Error Resume Next
Range("G8").Select
On Error Resume Next
ActiveSheet.PivotTables("PivPOLevel").ClearAllFilters
On Error Resume Next
Sheets("Sheet 2").Select
Range("B3").Select
ActiveSheet.PivotTables("PivSummary").ClearAllFilters
Sheets("Sheet 1").Select
ActiveSheet.PivotTables("PivPOLevel").PivotFields("997 Exception?"). _
ClearAllFilters
ActiveSheet.PivotTables("PivPOLevel").PivotFields("997 Exception?"). _
CurrentPage = "X"
ActiveSheet.PivotTables("PivPOLevel").PivotFields("PGI description"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivPOLevel").PivotFields("PGI description")
.PivotItems("").Visible = False
.PivotItems("(blank)").Visible = False
.PivotItems("30").Visible = False
.PivotItems("00").Visible = False
.PivotItems("10").Visible = False
.PivotItems("70").Visible = False
.PivotItems("20").Visible = False
.PivotItems("32").Visible = False
End With
ActiveSheet.PivotTables("PivPOLevel").PivotFields("PGI description"). _
EnableMultiplePageItems = True
ActiveSheet.PivotTables("PivPOLevel").PivotFields("DMK").ClearAllFilters
ActiveSheet.PivotTables("PivPOLevel").PivotFields("DMK").CurrentPage = "Z1"
With ActiveSheet.PivotTables("PivPOLevel").PivotFields("Supplier")
.PivotItems("30004142").Visible = False
End With
Sheets("Sheet 2").Select
ActiveSheet.PivotTables("PivSummary").PivotFields("Vendor ").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivSummary").PivotFields("Vendor ")
.PivotItems("SUPPLIER 1").Visible = False
End With
ActiveSheet.PivotTables("PivSummary").PivotFields("PGI Desc.").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivSummary").PivotFields("PGI Desc.")
.PivotItems("(blank)").Visible = False
.PivotItems("30").Visible = False
End With
ActiveSheet.PivotTables("PivSummary").PivotFields("DMK").ClearAllFilters
ActiveSheet.PivotTables("PivSummary").PivotFields("DMK").CurrentPage = "Z1"
ActiveSheet.PivotTables("PivSummary").PivotFields("Comments on Open POs"). _
CurrentPage = "(All)"
With ActiveSheet.PivotTables("PivSummary").PivotFields("Comments on Open POs")
.PivotItems( _
"PO has already been rolled today. Please reach out if you cannot find the associated PO." _
).Visible = False
End With
Sheets("Setup").Select
End Sub
I did all of this using the macro record function. The issue I'm having is with the final filter. The entries into this will change all the time, apart from the default error message "PO has already been rolled today. Please reach out if you cannot find the associated PO."
I need that last filter to always filter OUT anything with this statement, regardless of whatever else might appear in the filter.
I thought putting <> between the open " and the first word did this but it doesn't seem to work. Currently when I run the macro it happily filters everything else and leaves this one untouched.
Thanks in advance for any help!