Get date details from Timeline

Ucubia

Board Regular
Joined
Mar 17, 2010
Messages
88
Hi,

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?

Would appreciate any advise.

Many thanks

Ian
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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
 
Upvote 0
Thank you for this - I will see if I can adapt it to get to where I need to be.

I was hoping for an Excel function something akin to Getpivotdata in order to extract the information I need but that doesn't seem to be possible

Will have a go.

Thanks again
 
Upvote 0
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?
 
Upvote 0
I did it this way to avoid having to use any VBA:


(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)
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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