VBA to change pivot table source data based on cell value (or Slicer)

aWorkingPig

New Member
Joined
Jul 25, 2020
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
Hi all,

I have a spreadsheet with 52 identical sheets/tables, plus a formula based dashboard to monitor week to week changes.

I would like to set up some pivot tables to pull data from the corresponding table based on the week/ date selected in either a Data Validation list or ideally a Slicer.

I've been able to do this manually by selecting 'change data source' but am hoping someone can help with a possible VBA solution to change the pivot table source data based on a cell value or Slicer (i.e. by selecting the Week no. or Date)

I already have a list of the 52 weeks. "Week 1 and 30/03/2020, Week 2 and 06/04/2020...."
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,200
Messages
6,123,612
Members
449,109
Latest member
Sebas8956

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