VeryForgetful
Board Regular
- Joined
- Mar 1, 2015
- Messages
- 242
Hi,
I have several PivotTables where I update the month via a timeline slider in my worksheet.
In my sourcedata I also have a additional column which shows the relevant day for each row of data, =DAY(A2) etc. I have a slicer in my book that is linked to each of these tables which shows the days for each month, 1 through to 31. The problem I am having is that the number of days for the relevant month isn't automatically greying out days that don't exist. So for example if the timeline is selecting Feb 2016 then the slicer should grey out 29/02 and 30/02 as those days don't exist for that month.
Basically what I need to do is get the slicer and timeline to link to each other like they do independently with the PivotTables.
If I right click the slicer and refresh manually, the values are correctly updated and greyed out.
Recording a macro of this gives me:
Any suggestions please?
I have several PivotTables where I update the month via a timeline slider in my worksheet.
In my sourcedata I also have a additional column which shows the relevant day for each row of data, =DAY(A2) etc. I have a slicer in my book that is linked to each of these tables which shows the days for each month, 1 through to 31. The problem I am having is that the number of days for the relevant month isn't automatically greying out days that don't exist. So for example if the timeline is selecting Feb 2016 then the slicer should grey out 29/02 and 30/02 as those days don't exist for that month.
Basically what I need to do is get the slicer and timeline to link to each other like they do independently with the PivotTables.
If I right click the slicer and refresh manually, the values are correctly updated and greyed out.
Recording a macro of this gives me:
Code:
ActiveWorkbook.SlicerCaches("Slicer_Day").PivotTables(1).PivotCache.Refresh
Any suggestions please?