VBA code to do a filter across multiple sheets

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
784
Office Version
  1. 365
Platform
  1. Windows
Good morning

I currently am using the VB code below to manage 3 pivot table in a sheet feeding from different sources using slicers
The below code looks at the filters based on a pivot table and then aligns the other tables accordingly.

The issue I am looking at currently is I need to apply a filter based on the "Team Lead" which will work in the initial pivot table by the slicer, but when I come to mirror it in the other tables I am having an issue as "Team Lead" isn't a filter option as it is an output in the "Rows" of the pivot table and I cant move this due to the visuals produced in the image below

Is there a way of selecting the Manager based on the C18 reference without it being a filter option

Code:
Sheets("Sheet1").Select
        Range("K27").Select
            Set pvFld = ActiveSheet.PivotTables("PivotTable1").PivotFields("Team Lead")
                strFilter = ActiveWorkbook.Sheets("Customer Experience").Range("C18").Value
                    pvFld.CurrentPage = strFilter

thanks in advance
 

Attachments

  • Capture.PNG
    Capture.PNG
    10 KB · Views: 5

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