title: VBA Autofilter not filtering by my criteria
body: <p>I created a filter feature that was working before, but I left it for a couple days (over the weekend) and it doesn't filter correctly.</p>
  
  <p>I have included the code below for examination.  I have run watches, and everything seems to be getting to the autofilter line correctly.  I am running out of ideas.</p>
  
  <p>Is there something I may have changed on the sheet itself that is breaking autofilter?  Could I have added something in one of the criteria that is breaking it?  </p>
  
  <p>Thanks</p>
  
  <p>NOTE: any variables not DIMed are either globals or junk variables.  Also, the index for sortfield may be off; I am working on following that.  It still seems that when filtering in the correct column, it just filters out everything.</p>
  
  <pre><code>Private Sub Filter_CommandButton_Click()
      'Filters by a text input and a column to filter
      Dim isInCol As Boolean
      Dim sortKey As String
      Dim sortOrder As XlSortOrder
      Dim currentData As Range
      Dim sortField As Integer ' This is the offset, determined by list index
      Dim lastRow As Integer ' used to set working range
  
  
      If filterColumn Is Nothing Then
          gojira = MsgBox("You need to enter a column to filter", vbOKOnly)
          Exit Sub
      End If
  
      ' Set target = ActiveWorkbook.Worksheets("Testing_Filter_Form")
      lastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1 ' target.Cells(Rows.Count, "A").End(xlUp).Row + 1
  
      ' put borders around whole row
      ' target.Range(target.Cells(lastRow, 1), target.Cells(lastRow, 56)).Borders.LineStyle = xlContinuous
  
      ' setting active sheet complete data
      Set currentData = ActiveSheet.Range(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(lastRow, 12))
  
      ' make sort key a wildcard
      If include = True Then
          sortKey = "*" &amp; filterText &amp; "*"
      Else ' for excluding the entered text
          sortKey = "&lt;&gt;" &amp; "*" &amp; filterText &amp; "*"
      End If
  
      ' find list index for sorting
      sortField = Me.ColumnFilter_ComboBox.ListIndex ' + 1
  
      ' populate sort order with value of Ascend/Descend options.
      If descend Then
          sortOrder = xlDescending
      Else
          sortOrder = xlAscending
      End If
  
      ' Search column to see if text exists
      isInCol = False
      For Each foo In filterColumn
          If caseSense Then
              If InStr(foo.Value, filterText) Then ' &gt; 0 Then
                  isInCol = True
                  Exit For
              End If
          ElseIf Not caseSense Then
              If InStr(LCase(foo.Value), LCase(filterText)) Then
                  isInCol = True
                  Exit For
              End If
          End If
      Next foo
  
      If isInCol Then ' filter the table by the selected col; Use Range Sort
          With target
              currentData.AutoFilter Field:=sortField, Criteria1:=sortKey, VisibleDropDown:=False
              currentData.Sort key1:=filterColumn, Order1:=sortOrder, Header:=xlYes
          End With
      End If
  
      blah = bleh
  End Sub
  </code></pre>