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

aWorkingPig

New Member
Joined
Jul 25, 2020
Messages
2
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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,601
Messages
5,838,284
Members
430,536
Latest member
Manoj Gaidhankar

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
Top