title: Excel Macro Autofilter issue with variable
body: <p>I have a table of data with the top row being filters, I have a loop that changes which filter needs to be used inside the loop is the variable filterColumn that is being assigned a new value every time the loop runs through.</p>
  
  <p>when i try to use filterColumn to determine which filter will be 'switched on' i get an error </p>
  
  <blockquote>
    <p>Autofilter method of Range Class Failed</p>
  </blockquote>
  
  <p><code>ActiveSheet.Range("$U$83:$CV$1217").AutoFilter Field:=filterColumn, Criteria1:="&lt;&gt;"</code></p>
  
  <p>What is the correct syntax in order to use a variable to determine which field the filter is in?</p>
  
  <p><strong>Problem Solved</strong> I found the solution. I was referencing the filters columns position in terms of the whole worksheet when in fact I should have been referencing what number it was in the group of filters. For example the filter I wanted to change was in 'CF' which is the 84th column but my the filter I wanted to change is the 64th in the group.</p>