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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,214,388
Messages
6,119,227
Members
448,878
Latest member
Da9l87

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