title: Excel VBA to move data from a table in one sheet to a table in another sheet
body: <p>I have an Excel workbook with two tabs. The first tab is titled "StagingArea" (table name on sheet is _StagingArea) which has data grouped by module. What I'm trying to do is dynamically move data from the table in the "StagingArea" sheet (_StagingArea) to the table in the "Module1" sheet (_Module1). So, if a new row gets added for module 'Module1' in "StagingArea" I need that to then be moved to "Module1" sheet. So far, I have the following code:</p>
  
  <pre><code>Private Sub Workbook_Open()
  Dim i, LastRow
  
  LastRow = Sheets("Staging Area").Range("A" &amp; Rows.Count).End(xlUp).Row
  For i = 2 To LastRow
  If Sheets("Staging Area").Cells(i, "A").Value = "Module1" Then
  Sheets("Staging Area").Cells(i, "A").EntireRow.Copy Destination:=Sheets("Module1").Range("_Module1").End(xlUp).Offset(1)
  End If
  Next i
  End Sub
  </code></pre>
  
  <p>The problem I'm running into is that it is looping through the rows for "Module1" but only inserting the last row into the table on sheet "Module1."</p>
  
  <p>I also need to then delete the rows from "StagingArea" sheet that were copied/moved over to the "Module1" sheet. Thanks for any help you can provide!</p>