title: Conditional Autofilter over multiple fields in a single autofilter
body: <p>I'm creating some coding for a statement of accounts macro and I'm checking if there is such a thing as a conditional autofilter over multiple fields, ie:</p>
  
  <pre><code>TSOA.Range.AutoFilter Field:=8, Criteria1:="Unpaid", Operator:=xlOr, Field:=9, Criteria2:="&gt;" &amp; Dbl3M
  </code></pre>
  
  <p>So I need entries that are either unpaid or within 3 months of this month (not mutually exclusive, so the only ones that are really filtered out are paid and older than 3 months ago). So any entries after the 28/02/2015, paid or unpaid, must be included (I know this sound complicated).</p>
  
  <p>Anyway if this doesn't work, I've got some workarounds up my sleeve by autofiltering them by individual criteria, adding them both to a single array and removing duplicates! I just wanted to know the limitations of the autofilter function and whether this could actually be done. Thank you.</p>
  
  <p>An illustration of how it works:</p>
  
  <p><img src="https://i.stack.imgur.com/BaJLG.png" alt="enter image description here"></p>
  
  <p>So I arbitrarily made entries up to 14/04/2015 as "Paid", The filterbutton filters up to only 3 months of data left from last month (May-2), it also must include "unpaid" entries from older than 3 months ago, and include "paid" entries within the 3 months. </p>
  
  <p>Here's some of the rest of the code if it helps you understand:</p>
  
  <pre><code>Private Sub FilterButton2_Click()
  
  Dim Balance As Double
  Dim DblMonth As Double
  
  With ThisWorkbook
  
  Set TSOA = .Worksheets("SOA").ListObjects(1)
  DblMonth = CLng(DateSerial(Year(Date), Month(Date), 0)) 'integer value of last month last day
  Dbl3M = CLng(DateSerial(Year(Date), Month(Date) - 2, 0)) 'integer value of 3 months ago last day
  
  If TSOA.AutoFilter.FilterMode = True Then
      TSOA.AutoFilter.ShowAllData
      TSOA.ListColumns(10).DataBodyRange.ClearContents
      Exit Sub
  Else: str3 = InputBox("Please input client initials", "Client filter")
      If Application.WorksheetFunction.CountIf(.Worksheets("SOA").Range("D:D"), str3) = 0 Or str3 = "" Then
      MsgBox "Client cannot be identified!", , "Error"
      Exit Sub
      End If
  End If
  
  **ActiveSheet.AutoFilterMode = False
  TSOA.Range.AutoFilter Field:=4, Criteria1:=str3
      TSOA.Range.AutoFilter Field:=8, Criteria1:="Unpaid", Operator:=xlOr, Field:=9, Criteria2:="&gt;" &amp; Dbl3M**
  
  For K = 1 To TSOA.ListRows.Count
  
  If Not TSOA.DataBodyRange.Rows(K).Hidden Then
      Balance = Balance + TSOA.DataBodyRange(K, 6).Value
      TSOA.DataBodyRange(K, 10).Value = Balance
  End If
  Next
  
  End With
  End Sub
  </code></pre>