Hi!
I tried to use the sync slicers guide (https://www.mrexcel.com/news/sync-slicers-in-excel/) but it's not working for me.
This is the code I have:
The 2 slicers are on worksheet 1. The pivottables are on 6 other worksheets. So:
Worksheet 1: 2 slicers
Worksheet 2: 1 pivottable connected to slicer 1
Worksheet 3: 1 pivottable connected to slicer 1
Worksheet 4: 1 pivottable connected to slicer 1
Worksheet 5: 1 pivottable connected to slicer 2
Worksheet 6: 1 pivottable connected to slicer 2
Worksheet 7: 1 pivottable connected to slicer 2
Is that something I need to specify in the code?
Thanks!
I tried to use the sync slicers guide (https://www.mrexcel.com/news/sync-slicers-in-excel/) but it's not working for me.
This is the code I have:
Code:
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
Dim sc1 As SlicerCache
Dim sc2 As SlicerCache
Dim SI1 As SlicerItem
' These names come from Slicer Settings dialog box
Set sc1 = ThisWorkbook.SlicerCaches("Slicer_ISO_Year____Week____Day")
Set sc2 = ThisWorkbook.SlicerCaches("Slicer_ISO_Year____Week____Day1")
Application.ScreenUpdating = False
Application.EnableEvents = False
sc2.ClearManualFilter
For Each SI1 In sc1.SlicerItems
sc2.SlicerItems(SI1.Name).Selected = SI1.Selected
Next SI1
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Worksheet 1: 2 slicers
Worksheet 2: 1 pivottable connected to slicer 1
Worksheet 3: 1 pivottable connected to slicer 1
Worksheet 4: 1 pivottable connected to slicer 1
Worksheet 5: 1 pivottable connected to slicer 2
Worksheet 6: 1 pivottable connected to slicer 2
Worksheet 7: 1 pivottable connected to slicer 2
Is that something I need to specify in the code?
Thanks!
Last edited by a moderator: