Can anyone please shed some light on how to turn the below so it works in powerpivot? (slicer from power pivot source data)
Let me know any questions - looking forward to hearing any tips 🙂 🙂
Thanks! 🙂
Option Explicit Sub ExportPDFs() Dim sI As SlicerItem, sI2 As SlicerItem, sc As SlicerCacheDim fname$ Set sc = ActiveWorkbook.SlicerCaches("Slicer_Date") With sc For Each sI In sc.SlicerItems If sI.HasData = True Then sc.ClearManualFilter For Each sI2 In sc.SlicerItems If sI.Name = sI2.Name Then sI2.Selected = True Else: sI2.Selected = False Next Debug.Print sI.Name fname = sI.Caption & " " & Format(Date, "MM-DD-YYYY") & " " & "Report" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fname, _ Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False End If Next ActiveWorkbook.SlicerCaches("Slicer_Year").ClearManualFilter MsgBox "Reports Saved" End With End Sub