Good afternoon.
I have a question regarding the Learn Excel - Sync Slicers from Different Data Sets video. I am trying to figure out how to get this working with 3 slicers.
The slicer that I am trying to use as the operating slicer is called Slicer_Week. The other two are called Slicer_Week2 and Slicer_Week 3.
When I try to run this macro I get the errorcode 438 and points to the following line: sc2.SlicerItems(SI1.Week2).Selected = SI1.Selected
I have tried many things to get it working but without succes. Can anyone help me? Thanks in advance
I have a question regarding the Learn Excel - Sync Slicers from Different Data Sets video. I am trying to figure out how to get this working with 3 slicers.
The slicer that I am trying to use as the operating slicer is called Slicer_Week. The other two are called Slicer_Week2 and Slicer_Week 3.
When I try to run this macro I get the errorcode 438 and points to the following line: sc2.SlicerItems(SI1.Week2).Selected = SI1.Selected
I have tried many things to get it working but without succes. Can anyone help me? Thanks in advance
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim sc1 As SlicerCache
Dim sc2 As SlicerCache
Dim sc3 As SlicerCache
Dim SI1 As SlicerItem
Dim SI2 As SlicerItem
' These names come from Slicer Settings dialog box
Set sc1 = ThisWorkbook.SlicerCaches("Slicer_Week")
Set sc2 = ThisWorkbook.SlicerCaches("Slicer_Week2")
Set sc3 = ThisWorkbook.SlicerCaches("Slicer_Week3")
Application.ScreenUpdating = False
Application.EnableEvents = False
sc2.ClearManualFilter
sc3.ClearManualFilter
For Each SI1 In sc1.SlicerItems
sc2.SlicerItems(SI1.Week2).Selected = SI1.Selected
Next SI1
For Each SI2 In sc1.SlicerItems
sc3.SlicerItems(SI2.Week3).Selected = SI2.Selected
Next SI2
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: