Return Timeline Selection

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,598
Office Version
  1. 365
Platform
  1. Windows
Is it possible to either return the Label Selection or the periods selected from a Timeline attached to a pivot table?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Yes.

Code:
Sub Marine()
'
Dim t As TimelineState


Set t = ActiveWorkbook.SlicerCaches("NativeTimeline_date1").TimelineState
MsgBox t.StartDate & vbLf & t.EndDate
End Sub
 
Upvote 0
Thanks for this but is it possible to do this via a formula?
 
Upvote 0
You could use a UDF. If no VBA is allowed, I can try a different approach.

Excel Workbook
GH
4301/01/201531/03/2015
Plan16

Code:
Function MM()
Dim v(), t As TimelineState
ReDim v(1 To 2)
Set t = ActiveWorkbook.SlicerCaches("NativeTimeline_date1").TimelineState
v(1) = t.StartDate
v(2) = t.EndDate
MM = v
End Function
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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