Option Explicit
Sub FilterToggle()
Dim oWB As Workbook: Set oWB = ThisWorkbook
Dim oWS As Worksheet
For Each oWS In Worksheets
With oWS
If .AutoFilterMode = True Then
.AutoFilterMode = False
Else
.UsedRange.AutoFilter
End If
End With
Next oWS
End Sub
1条答案
按热度按时间6kkfgxo01#
您可以指定一个按钮,或者在需要循环遍历所有工作表并测试过滤器时运行宏。下面的代码将让你开始。
字符串