How to auto-refresh an Excel auto-filter when data is changed?
Solution 1:
Exchanging the code with this seems to do the trick as well (at least in Excel 2010):
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.AutoFilter.ApplyFilter
End Sub
Solution 2:
I found that when I worked with tables, this didn't work. The filter was not on the sheet but on the table. this code did the trick
Private Sub Worksheet_Change(ByVal Target As Range)
With ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1")
.AutoFilter.ApplyFilter
End With
End Sub
I found the information here: http://www.jkp-ads.com/articles/Excel2007TablesVBA.asp