title: Vba: Problem accessing sorted and doubly filtered column' s values
body: <p>I am working on VBA and the task I need to carry out is firstly to sort the values of a column inside a sheet, then to filter for values inside another column, then to filter again inside another column and then to access elements inside the just filtered column.
  I am doing the following:    </p>
  
  <p>Sorting:</p>
  
  <pre><code>   Worksheets(1).AutoFilter.Sort.SortFields.Clear
      Worksheets(1).AutoFilter.Sort.SortFields.Add2 Key _
          :=Range("H1:H" &amp; Range("H" &amp; Rows.Count).End(xlUp).Row), SortOn:=xlSortOnValues, Order:=xlAscending, _
          DataOption:=xlSortNormal
      With ActiveWorkbook.Worksheets(1).AutoFilter.Sort
          .Header = xlYes
          .MatchCase = False
          .Orientation = xlTopToBottom
          .SortMethod = xlPinYin
          .Apply
      End With
  </code></pre>
  
  <p>First filter:</p>
  
  <pre><code>Worksheets(1).Range("A2:AB" &amp; Range("A" &amp; Rows.Count).End(xlUp).Row).AutoFilter Field:=11, Criteria1:="variable1"
  </code></pre>
  
  <p>Second filter:</p>
  
  <pre><code>'Worksheets(1).Range("A2:AB" &amp; Range("A" &amp; Rows.Count).End(xlUp).Row).AutoFilter Field:=5, Criteria1:= _  "variable2", Operator:=xlAnd
  </code></pre>
  
  <p>Activating values:</p>
  
  <pre><code>'Range("E2:E" &amp; Range("E" &amp; Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Activate
  </code></pre>
  
  <p>Accessing values:</p>
  
  <pre><code>For Each z In Range("E2:E" &amp; Range("E" &amp; Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible)
        'MsgBox (z.Value)
  </code></pre>
  
  <p>Doing the following, when activating the double filtered column, all the sheet get activated and not just the filtered column I am interested in. Whereas, if I remove:</p>
  
  <pre><code>   Worksheets(1).AutoFilter.Sort.SortFields.Clear
  </code></pre>
  
  <p>from above, the accessing works properly, but I need this string of code otherwise the sorting is wrong.</p>
  
  <p>What is going on ?</p>