title: Autofilter Field using the header Name
body: <p>i tried to use the Autofilter function  but using field with the header name "ID" instead the number of column. i tried my best and i got this error message "Advanced filter fails at iterations, run-time error 1004"</p>
  
  <p>I am stuck for two days with it . thnk's for your help </p>
  
  <p>code :</p>
  
  <pre><code>Sub AdataPreparation()
  Dim WorkBk As Workbook, WorkSh As Worksheet, WrkTab As range, FilterRow As Variant
  Set WorkBk = Workbooks.Open(Filename:="C:\Users\Documents\DataApplied.xlsm")
  Set WorkSh = Sheets("sheet2") 
  WorkSh.Activate 
  Set WrkTab = range("A1").CurrentRegion 
  WrkTab = ActiveRange
  FilterRow = Application.Match("ID", WrkTab, 0)
  Selection.AutoFilter Field:=FilterRow, Criteria1:="="
  End Sub
  </code></pre>