Clear Auto Filter on Close (or open)

K

Karin

Hi,

How would I ensure that if Auto Filter is on, it is cleared when the
workbook is closed (or opened)? I'm not much of a programmer, but I can copy
and paste! :)

TIA
 
D

Dave Peterson

Does clear mean show all or remove the filter arrows?

I'm guessing that it means show all (but leave the arrows).

Put something like this in a General module:

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
If .FilterMode Then
.ShowAllData
End If
End With
End Sub

Change the sheet name to match what you need.
 
K

Karin

Dave, Thank you, but it doesn't work. The auto filter remains on. In answer
to your question, I want the auto filter arrows to remain, but to clear any
filtering. I tried modifying your code with .autofiltermode but that didn't
change anything. (I did use my correct worksheet name, which is ClientList.)
 
Top