Help Selecting Range in PivotTable Filter

whydaman

New Member
Joined
Oct 4, 2017
Messages
1
I'm wondering if someone could provide some guidance my way on how to set up a range determination for PivotTable filters. In the code below that I recorded, I found that the macro recorded everything that I didn't want to select from the list (basically, everything less than 7). Is there a means to code something in VBA that would show the equivalent of .PivotItems("<7").Visible = False?



ActiveSheet.PivotTables("No Call 7+").PivotFields("Appr Days Out").CurrentPage _
= "(All)"
With ActiveSheet.PivotTables("No Call 7+").PivotFields("Appr Days Out")
.PivotItems("0").Visible = False
.PivotItems("1").Visible = False
.PivotItems("-3").Visible = False
.PivotItems("-4").Visible = False
.PivotItems("5").Visible = False
.PivotItems("6").Visible = False
.PivotItems("(blank)").Visible = False
End With
ActiveSheet.PivotTables("No Call 7+").PivotFields("Appr Days Out"). _
EnableMultiplePageItems = True
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

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