title: VBA code for updating autofilters without re-applying
body: <p>While updating a table with VBA, is there a way to refresh the autofilters without manually re-applying it? Say, I have a value in A1 that serves as the filter for Column 1 of Table 1. When I clear the content in A1, can VBA automatically clear the filter in column 1 without re-executing the code? Or if I update the value of A1, is there a way for the filter of column1 to be automatically updated as well? </p>
  
  <p>I have tried</p>
  
  <pre><code>Sub Name()
  ActiveSheet.AutoFilter.ApplyFilter
  End Sub
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Sub Name(ByVal Target As Range)
  Sheets("Sheet1").AutoFilter.ApplyFilter
  End Sub
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Sub Name(ByVal Target As Range)
  With ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1")
       .AutoFilter.ApplyFilter
  End With
  End Sub
  </code></pre>
  
  <p>from various sources. I made sure the code is embedded in the same sheet as the filter modules, but I still seem to be doing something wrong... Any help would be appreciated!</p>
  
  <p>link to sources:</p>
  
  <p><a href="https://www.extendoffice.com/documents/excel/4180-excel-refresh-filter-automatically.html" rel="nofollow noreferrer">https://www.extendoffice.com/documents/excel/4180-excel-refresh-filter-automatically.html</a>
  <a href="https://superuser.com/questions/1004207/macro-for-reapply-filter-on-excel-2016">https://superuser.com/questions/1004207/macro-for-reapply-filter-on-excel-2016</a>
  <a href="https://superuser.com/questions/249758/how-to-i-auto-refresh-an-excel-auto-filter-when-data-is-changed">https://superuser.com/questions/249758/how-to-i-auto-refresh-an-excel-auto-filter-when-data-is-changed</a></p>