iggydarsa
Well-known Member
- Joined
- Jun 28, 2005
- Messages
- 1,810
- Office Version
- 365
- Platform
- Windows
Hi All,
I have two tables with slicers with similar data layout on separate sheets.
When I select an option on one slicer I want the same option to be selected on the other slicer.
I came up with this code but not sure on what event it should be triggered:
If I assign this macro on the click event of the slicer it doesn't let me select any options.
Thanks!!
I have two tables with slicers with similar data layout on separate sheets.
When I select an option on one slicer I want the same option to be selected on the other slicer.
I came up with this code but not sure on what event it should be triggered:
VBA Code:
Sub Macro1()
ActiveWorkbook.SlicerCaches("Slicer2").SlicerItems("Earth").Selected = ActiveWorkbook.SlicerCaches("Slicer1").SlicerItems("Earth").Selected
ActiveWorkbook.SlicerCaches("Slicer2").SlicerItems("Fire").Selected = ActiveWorkbook.SlicerCaches("Slicer1").SlicerItems("Fire").Selected
ActiveWorkbook.SlicerCaches("Slicer2").SlicerItems("Water").Selected = ActiveWorkbook.SlicerCaches("Slicer1").SlicerItems("Water").Selected
ActiveWorkbook.SlicerCaches("Slicer2").SlicerItems("Air").Selected = ActiveWorkbook.SlicerCaches("Slicer1").SlicerItems("Air").Selected
End Sub
If I assign this macro on the click event of the slicer it doesn't let me select any options.
Thanks!!