Control/sync multiple slicer timelines from one slicer timeline

baseline9

New Member
Joined
Feb 15, 2016
Messages
5
Hi

I have two pivot tables and I want to be able to control date ranges in those pivot tables with a timeline slicer. The problem is I want to control them based upon different dates (Different fields in the raw data). So I want to select 01/01/2016 based upon date1 in one pivot and 01/01/2016 based upon date2 in another pivot.

I can have 2 slicers but the user will only want to click one. I think the solution would be is to have one master timeline slicer showing and then one in the background/hidden that also changes when the master timeline slicer is changed. I think this could be possible via VBA?

Once I have done this for two dates then my aim is two extend it out to more

I really hope someone can help :)

I'm on XL2013

Many thanks!
 
Hi Roderick,

Thanks for the advice. I've checked that the names of the timelines are correct. However, it still return me Run-time error 1004 (Application-defined or object-defined error).



I realised the error triggered when I clear filter from the selected timeline. I've tried to add the code to handle clear filter, however, I was prompted with Run-time error object does not support this property or method and the bCleared line was highlighted.

Sub AllTimelines()
Dim FromDate As Date
Dim ToDate As Date
Dim oTimeline As TimelineState
Dim bCleared As Boolean


Set oTimeline = ActiveWorkbook.SlicerCaches("NativeTimeline_Date_of_Appt").TimelineState
bCleared = oTimeline.FilterCleared

If oTimeline.bCleared Then
ActiveWorkbook.SlicerCaches("NativeTimeline_Last_Day_of_Service").TimelineState.FilterCleared
Else
'controlling timeline
FromDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date_of_Appt").TimelineState.FilterValue1
ToDate = ActiveWorkbook.SlicerCaches("NativeTimeline_Date_of_Appt").TimelineState.FilterValue2

'shadow timeline(s)
ActiveWorkbook.SlicerCaches("NativeTimeline_Last_Day_of_Service").TimelineState.SetFilterDateRange FromDate, ToDate

End If


End Sub
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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