VBA code to select Pivot Tables Filters Based on a list

TheHack22

Board Regular
Joined
Feb 3, 2021
Messages
121
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hi All,

I have a weekly tasks where I have to create Pivot Tables for each Geographical Regions. I don't need to create the PT by VBA. Just need to flip filters (Tab Pivot Tables- Pivot Table name = "PivotTable2") based on a list(Regions). I would like to automate this by:
Select the Pivot Table Filters (Screen shot) based on a list on Regions on another sheets. Example - I'll like the VBA to look at my list of Regions, select the filters to show Southern, make a copy of the sheet of Southern, then continue with the next Region(Northern), make a copy the sheet for Northern, until the list exhausted - a pivot table is create for each region.

End result is: I have pivot table for each region on separate sheet

Thanks in advance for you help :)

1612809520747.png


Imran
 

Attachments

  • 1612809149267.png
    1612809149267.png
    71.9 KB · Views: 9

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,919
Messages
6,122,260
Members
449,075
Latest member
staticfluids

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