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...."
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Watch MrExcel Video

Forum statistics

Threads
1,113,892
Messages
5,544,893
Members
410,643
Latest member
sng
Top