title: Maximum Amount Of "And" Statements In IF
body: <p>I am trying to test on an "IF" statement with 5 criteria, the code works fine if I'm only testing with 3 criteria, but as soon as I add any extra it stops working. No errors, it just stops.</p>
  
  <pre><code>If Me.Count_Criteria_5.Value &lt;&gt; "Any" Then
  
      For i = RowNum To RowNumEnd
          If ws.Cells(i, CR1).Value = V_1 And ws.Cells(i, CR2).Value = V_2 And _
          ws.Cells(i, CR3).Value = V_3 And ws.Cells(i, CR4).Value = V_4 And _
          ws.Cells(i, CR5).Value = V_5 Then
          ws.Range("A" &amp; i &amp; ":AM" &amp; i).Copy
  
          ps.Activate
          'find first empty row in database
          emR = ps.Cells.Find(What:="*", SearchOrder:=xlRows, _
          SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
          ps.Range("A" &amp; emR &amp; ":AM" &amp; emR).PasteSpecial
  
      End If
      Next i
  Exit Sub
  
  End If ' End 5 Criteria Loop
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <p>Note: <code>ws</code> and <code>ps</code> are defined as worksheets</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Based on the comments on this question, the problem appears to be the criteria being used. It's because of testing against checkboxes. Checkboxes when checked return the value of <code>TRUE</code>. But when testing with this code, it doesn't recognise that the "TRUE" on the worksheet is the same as the "TRUE" in the V_#</p>
  
  <p>Anyone have any ideas?</p>