Excel 2013 VBA清除所有过滤器宏
似乎旧的宏不工作了。我有适当的安全设置来运行VBA宏,但当我尝试了一些方法来清除一个工作表上的所有过滤器时,我得到了一个编译错误。
以下是我所尝试的。
Sub AutoFilter_Remove()
'这个宏删除了任何过滤,以便显示所有的数据,但它没有删除过滤器的箭头
ActiveSheet.ShowAllData
End Sub
我在工作表上设置了清除所有过滤器的按钮,以方便用户使用,因为工作表有很多列都有过滤器。
38
3
试试这个。
如果床单上已经有了一个过滤器,那么。
将删除它。
试试这样的方法。
如果工作表处于过滤模式,
.FilterMode
返回true。(见此了解更多信息。) 关于`.AutoFilter'的更多信息,请看这里。最后,this将提供关于
.ShowAllData
方法的更多信息。