我想在关闭时添加一个函数来清除工作簿上的所有过滤器(所有工作表)..我已经有了这个子,有人可以帮我编写脚本以包含过滤器清除吗?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim sht As Worksheet, csheet As Worksheet
Application.ScreenUpdating = False
Set csheet = ActiveSheet
For Each sht In ActiveWorkbook.Worksheets
If sht.Visible Then
sht.Activate
Range("A1").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
End If
Next sht
csheet.Activate
Application.ScreenUpdating = True
End Sub