title: Copy/Paste multiple rows in VBA
body: <p>I am attempting to do a simple copy row, paste row within a workbook. I've searched threads and tried changing my code multiple times to no avail. </p>
  
  <p>The one that comes closest to working is this but it only copies a single instance of matching criteria. </p>
  
  <p>I am trying to create a loop that will copy all of the rows that has a match in one of the columns. </p>
  
  <p>So, if 8 columns, each row with matching value in column 7 should copy to a named sheet. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Sub test()
  Set MR = Sheets("Main").Range("H1:H1000")
  Dim WOLastRow As Long, Iter As Long
  
      For Each cell In MR
      
  If cell.Value = "X" Then
  cell.EntireRow.Copy
  Sheets("X").Range("A" &amp; Rows.Count).End(xlUp).PasteSpecial
      End If
  If cell.Value = "Y" Then
  cell.EntireRow.Copy
  Sheets("Y").Range("A" &amp; Rows.Count).End(xlUp).PasteSpecial
      End If
  If cell.Value = "Z" Then
  cell.EntireRow.Copy
  Sheets("Z").Range("A" &amp; Rows.Count).End(xlUp).PasteSpecial
      End If
  If cell.Value = "AB" Then
  cell.EntireRow.Copy
  Sheets("AB").Range("A" &amp; Rows.Count).End(xlUp).PasteSpecial
      End If
      
  Application.CutCopyMode = False
  
  Next
  
  End Sub</code></pre>
  </div>
  </div>
  </p>
  
  <p>I like this because I need to target multiple destination sheets with different criteria but I need all rows that match criteria to copy over. </p>