I'm stumped on this one - I'm currently automating a file and I need the macro to select the most recent date slicer dynamically. My current code is selecting all of the dates listed in the slicer instead of the most recent date.
VBA Code:
Sub maxdateslicer()
Sheets("FIP").Select
Application.ScreenUpdating = False
With ActiveWorkbook.SlicerCaches("slicer_Execution_Date1")
.ClearManualFilter
For Each myitem In .SlicerItems
myitem.Selected = CDate(myitem.Name) = Date - 1
Next myitem
End With
Application.ScreenUpdating = True