Reputation: 31
I have a timeline
in my spreadsheet but I want to verify if the timeline exists via VBA code.
How do I check if there's one?
Upvotes: 0
Views: 157
Reputation: 49998
A timeline is a SlicerCache
with a SlicerCacheType
of xlTimeline
:
Sub FindTheTimeline()
Dim cache As SlicerCache
For Each cache In ThisWorkbook.SlicerCaches
If cache.SlicerCacheType = xlTimeline Then
Debug.Print "Got a timeline!"
Exit Sub
End If
Next
End Sub
Upvotes: 3