Enable Multi-select on slicer by default

前端 未结 4 1393
一生所求
一生所求 2021-01-15 09:23

I have slicers in my workbook that I need multi-select enabled by default.

I tried SendKeys.

ActiveSheet.Shapes.         


        
相关标签:
4条回答
  • 2021-01-15 09:51

    One workaround could be that you select the slicer and then use SendKeys-method.

    ActiveSheet.YOURSLICER.Select
    SendKeys "%s"  || sends ALT+S key combination to toggle multiselect ON.
    
    0 讨论(0)
  • 2021-01-15 09:52

    Adding a DoEvents after each SendKeys command makes this work for me.

    ActiveSheet.Shapes.Range(Array("WMS")).Select
    SendKeys "%S"
    DoEvents
    ActiveSheet.Shapes.Range(Array("Equipment")).Select
    SendKeys "%S"
    DoEvents
    
    0 讨论(0)
  • 2021-01-15 09:53

    I don't believe you can programatically change that Multiselect toggle as at the time I write this...that property isn't exposed to the user via VBA. Looks like you've either got to go change that setting on all slicers manually, or teach your users to hold down the CTRL key while they make their selections (which lets them make multiple selections as if that toggle was activated).

    0 讨论(0)
  • 2021-01-15 10:17

    your code is correct. just replace the S with s and delete (, True).

    0 讨论(0)
提交回复
热议问题