Skip filter when not found

ahuang3433

New Member
Joined
Jan 24, 2017
Messages
39
Hi,

Is there a way to make this pivot skip a the filter criteria if not found?

VBA Code:
ActiveSheet.PivotTables("PivotTable2").PivotFields("Item Availability"). _
        CurrentPage = "(All)"
    With ActiveSheet.PivotTables("PivotTable2").PivotFields("Item Availability")
        .PivotItems("ETA On Time & Qty Ordered Less than Demand").Visible = False
        .PivotItems("In Stock").Visible = False
        .PivotItems("No Gating PO").Visible = False
        .PivotItems("ETA Late").Visible = False
        .PivotItems("ETA On Time").Visible = False
        .PivotItems("Partial qty in INV. Balance No Gating PO").Visible = False
    End With
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Add this code to skip errors. It needs to be turned off as soon as possible as to not bypass other real errors that could foul things up.

On error resume next 'This will bypass the error and go to the next line of code
On error goto 0 'This will remove catching the error (That is a zero at the end)
 
Upvote 0
Add this code to skip errors. It needs to be turned off as soon as possible as to not bypass other real errors that could foul things up.

On error resume next 'This will bypass the error and go to the next line of code
On error goto 0 'This will remove catching the error (That is a zero at the end)
Hi Jeffery - I'm not sure I am following you on this. Can you provide an example?
 
Upvote 0
The more I think about it and because the pivot command is one unit, that won't work. You would have to go check your original table for each of those fields.

Why would your underlying data set for the pivot table change the fields?
 
Upvote 0
The more I think about it and because the pivot command is one unit, that won't work. You would have to go check your original table for each of those fields.

Why would your underlying data set for the pivot table change the fields?
I have it that way for presentation purposes. It's to isolate data that is not needed for review.
 
Upvote 0

Forum statistics

Threads
1,215,583
Messages
6,125,665
Members
449,247
Latest member
wingedshoes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top