Is there a way to either configure the slicer or create VBA code to run through the slicer buttons or a set number of them?
I have a table of data sorted by weeks. I'd like to automate running through say the last 8 weeks worth to show trend over time. Is there a way to do this?
Hi,
Instead of writing complex codes, the easiest approach is to add a new column to your table, with a simple formula, to create the groups you want.
The formula for this new column should look like:
Refresh the pivot table, and add this new field as a slicer. The slicer will have 2 buttons, one with Last 8 Weeks, and a blank one, for older data.
In this manner, you can create any groups you want.
Catalin
Good idea, Catalin. That reminds me of a post I did to show rolling 12 month periods:
https://www.myonlinetraininghub.com/excel-slicers-for-rolling-periods
Mynda