Workbook Reset AutoFilter to ShowAll

  • Thread starter Thread starter David J
  • Start date Start date
D

David J

I have a large workbook that has the Autofilter available for many people to
view and I want to be able to reset the Autofilter to Show All before the
workbook is saved or closed. Please explain how in code clearly for this
novice.
 
I found that it's better to reset the autofilter when the workbook is opened.

If you reset it when you close the workbook, you'll have to save the workbook.
And your users may not want to save their changes.

This goes into a General module:

Option Explicit
Sub auto_open()
dim wks as worksheet
for each wks in thisworkbook.worksheets
with wks
If .FilterMode Then
.ShowAllData
End If
end with
next wks
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top