Return Timeline Selection

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,406
Is it possible to either return the Label Selection or the periods selected from a Timeline attached to a pivot table?
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
3,818
Yes.

Code:
Sub Marine()
'
Dim t As TimelineState


Set t = ActiveWorkbook.SlicerCaches("NativeTimeline_date1").TimelineState
MsgBox t.StartDate & vbLf & t.EndDate
End Sub
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
3,818
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
 

Forum statistics

Threads
1,085,516
Messages
5,384,137
Members
401,883
Latest member
vidarv

Some videos you may like

This Week's Hot Topics

Top