I have built a scrolling timeline to select a month, but I would like to get month that has been selected to incorporate into another formula - is there a way to do this?
This should get you started. You can get a start and end date from the timeline with the code below. You may need to change the name of the slice cache in your code.
Code:
Sub Timeline()
Dim s As SlicerCache: Set s = ActiveWorkbook.SlicerCaches("NativeTimeline_Date")
Debug.Print s.TimelineState.StartDate
Debug.Print s.TimelineState.EndDate
End Sub
I am also in the same boat where I need to use start and end dates from a timeline in some formulas. I can't seem to get the above code to work. It could be my very basic understanding of VBA. Any chance you have a working workbook you could share so I can analyze?
Use a disconnected pivot table to generate a worksheet title that always shows the dates selected for a Timeline slicer.
sfmagazine.com
(Create a second copy of the pivot table; then make the 2nd pivot table display only the min and max dates from the dates field and use those in your formulae)
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.