gpt4 book ai didi

Excel 2013 VBA 清除所有筛选器宏

转载 作者:行者123 更新时间:2023-12-01 16:33:24 24 4
gpt4 key购买 nike

旧的宏似乎不起作用。我已经正确设置了运行 VBA 宏的安全性,但是当我尝试了几种清除工作表上所有过滤器的方法时,出现编译错误。

这是我尝试过的:


Sub AutoFilter_Remove()
'This macro removes any filtering in order to display all of the data but it does not remove the filter arrows
ActiveSheet.ShowAllData
End Sub

工作表上有用于清除所有过滤器的按钮,以便于用户使用,因为工作表上有很多带有过滤器的列。

最佳答案

试试这个:

If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData

关于Excel 2013 VBA 清除所有筛选器宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21761027/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com