Get Timeline Slicer date range for inclusion in graph title

LGXSteve

New Member
Joined
Sep 1, 2015
Messages
7
I have a pivot table (derived from PowerPivot) that displays data filtered by a Timeline Slicer. The Pivot table is then represented in a Pie Chart which has a title. Is there any way I can link the title to the Timeline Slicer range, so it indicates the date range for which the pie chart is valid. I suspect some VBA may be required, but it is a v. long time since I did any VBA, and never with PowerPivot.

(I am using Excel 2013)

Thanks in anticipation
 

santiazpi2

New Member
Joined
Nov 30, 2019
Messages
1
Office Version
365, 2016, 2013
Platform
Windows
I prefer 2 simple vba functions:

VBA Code:
Public Function TimelineStart(strTimelineName As String) As Date
    TimelineStart = ActiveWorkbook.SlicerCaches(strTimelineName).TimelineState.StartDate
End Function

Private Function TimelineEnd(strName As String) As Date
    TimelineEnd = ActiveWorkbook.SlicerCaches(strTimelineName).TimelineState.EndDate
End Function
You can get the slicer names from the names collection (Ctrl+F3)
 

Forum statistics

Threads
1,077,777
Messages
5,336,243
Members
399,072
Latest member
abublitz

Some videos you may like

This Week's Hot Topics

Top