Hi All,
I am trying and failing to extract slicer values into a worksheet (Msgbox). I have made a very basic pivot based on Months and Qty's and cannot figure out why I get a Run-Time error 5 on the 'Set cache = ActiveWorkbook.SlicerCaches("Month")' line.
Can someone please put me out of my misery and point out my mistake. Thanks
Dim cache As Excel.SlicerCache
Set cache = ActiveWorkbook.SlicerCaches("Month")
Dim sItem As Excel.SlicerItem
For Each sItem In cache.SlicerItems
If sItem.Selected = True Then MsgBox sItem.Name
Next sItem
I am trying and failing to extract slicer values into a worksheet (Msgbox). I have made a very basic pivot based on Months and Qty's and cannot figure out why I get a Run-Time error 5 on the 'Set cache = ActiveWorkbook.SlicerCaches("Month")' line.
Can someone please put me out of my misery and point out my mistake. Thanks
Dim cache As Excel.SlicerCache
Set cache = ActiveWorkbook.SlicerCaches("Month")
Dim sItem As Excel.SlicerItem
For Each sItem In cache.SlicerItems
If sItem.Selected = True Then MsgBox sItem.Name
Next sItem