|  

» Reset filter before saving a worksheet using VBA in Microsoft Excel

CATEGORY - VERSION -
Question:
Reset all filter criteria in all worksheets when saving a workbook.


Answer:
Insert the following code in This Workbook module.









Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean,Cancel As Boolean)
Dim wks As Worksheet
For Each wks In Worksheets
If wks.FilterMode = True Then
wks.ShowAllData
End If
Next wks
End Sub


Rate This Tip
12 34 5
Rating: 2.70     Views: 12649
No comments have been submitted.
Click here to post comment
For Registered Users
Name
Comment Title
Comments