I did a bit of modifying. I converted the data into excel tables simply because they are easier to work with. I created two named cells: LD_0 and LD_1 which are the latest date and next to latest date.
These dates need to be converted into strings that look like the format used in the pivot tables. Don't ask me why, but that's the way it is.
Setting the Filter for a report filter on a pivot table is easy. Just copy the value into the cell.
Setting filters for multi-selects are a bit more complicated. First you have to tell Excel what pivot table to update, then you have to tell it what field to filter on.
The code blows up if you try to turn off all the values for that filter. So if The first item is on and the second (and the rest of the items) are off and you turn the first item off, you will get an error. So this means, you need to turn everything on first, then you can turn off the selected items.
Bookmarks