How do I select the first item in either the slicer or the pivot table? This is a date field and both the pivot table and slicer are sorted by descending so the newest date is always listed first. The below code works if I always want to select October 27, 2020; however, I need the most recent date selected. Because of how I have my pivot table/slicer sorted, the newest date should always be listed first. Code that will either select the first item or select the newest date will work. The field is formatted as a date, not date/time.
I appreciate any assistance you can provide. Thank you.
----------------------------------------
Office 365 Business
VBA Code:
ActiveWorkbook.SlicerCaches("Slicer_Dates").VisibleSlicerItemsList = Array("[tblDates].[Dates].&[2020-10-27T00:00:00]")
I appreciate any assistance you can provide. Thank you.
----------------------------------------
Office 365 Business