title: VBA If with two criteria in two columns
body: <p>I need to look at two cells (C and F) on a each row, and if the value for C to ends with 30 and the value for F is greater than Zero, copy and paste the row to another sheet.  I've managed to get the copy and paste to work using 1 criteria, but I cannot figure out how to get both criteria to work together.</p>
  
  <pre><code>Sub compile1()
      Dim x As String
  
  Set rSearch = Sheets("Application").Range("C:C")
  
  
  For Each cell In rSearch
  x = cell.Value
         If Right(cell, 2) = "30" And cell.Offset(, 3) &gt; 0 Then
  
          matchRow = cell.Row
          Rows(matchRow &amp; ":" &amp; matchRow).Select
          Selection.Copy
  
          Sheets("sheet2").Select
          ActiveSheet.Rows(matchRow).Select
          ActiveSheet.Paste
          Sheets("Application").Select
      End If
  
  Next
  
  End Sub
  </code></pre>