macro pivot table select multiple items from pivot field

katie_1234

New Member
Joined
Feb 20, 2011
Messages
3
hi,
excel 2007
i want to select two items from a pivot field, but i don't want it to loop through all of the choices. It takes too long. is there a code that can do this. Maybe an if function? I don't know how to write a macro; i just record them. here is part of the macro i recorded that is very slow.

ActiveSheet.PivotTables("PivotTable3").PivotFields("color").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable3").PivotFields("color")
.PivotItems(" red").Visible = False
.PivotItems("red - RUN").Visible = False
.PivotItems("totals").Visible = False
.PivotItems("blue").Visible = False
.PivotItems("blue - RUN").Visible = False
.PivotItems("green").Visible = False
.PivotItems("yellow").Visible = False
.PivotItems("yellow- runl").Visible = False


Thank you for any help!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,224,550
Messages
6,179,463
Members
452,915
Latest member
hannnahheileen

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