slicers

How to update slicer cache with VBA

孤人 提交于 2019-11-26 23:43:20
问题 I'm using Excel VBA to hide/show elements on slicer depending upon user selection. I have the following code : Private Sub removeFilterWithSlicer() Dim slicerCache As slicerCache Set slicerCache = ThisWorkbook.SlicerCaches("Slicer_Channel1") slicerCache.SlicerItems("A").Selected = False slicerCache.SlicerItems("B").Selected = False slicerCache.SlicerItems("C").Selected = False slicerCache.SlicerItems("D").Selected = False slicerCache.SlicerItems("E").Selected = False slicerCache.SlicerItems(

VBA to connect slicers (looking for improvements to code)

情到浓时终转凉″ 提交于 2019-11-26 22:10:37
问题 I finally found a code that will connect slicers with different caches on pivot table update. Basically when the value of slicer1 changes, it will change slicer2 to match slicer1 thus updating any pivot table connected to the second slicer. I've added .Application.ScreenUpdating and .Application.EnableEvents in an attempt to speed up the macro but it's still laggy and causes Excel to become unresponsive. Is there a more direct way of coding this or are there any potentially volatile lines in