Excel 2013 VBA Clear All Filters macro

后端 未结 26 977
花落未央
花落未央 2020-11-27 16:26

It seems older macros are not working. I have proper securtiy set to run VBA macros but when I have tried a few methods for clearing ALL filters on a worksheet, I get a comp

26条回答
  •  孤独总比滥情好
    2020-11-27 17:00

    Here's the one-liner I use. It checks for an auto-filter and if found, removes it.

    Unlike some answers, this code won't create an auto-filter if used on a worksheet that is not auto-filtered in the first place.

    If Cells.AutoFilter Then Cells.AutoFilter
    

提交回复
热议问题