title: Dynamiclly move data from a table to another in excel vba
body: <p>I have two tables in two different worksheets under the same workbook.</p>
  
  <p>Table 1 &amp; Table 2</p>
  
  <ol>
  <li>I want to create a function that will take table 1 &amp; table 2 as
  parameters.</li>
  <li>Copy cells from table 1 to table 2 but we have have 2
  questions:</li>
  </ol>
  
  <p>Which column to update and which row to update to know the proper cell.</p>
  
  <p>Which column should be based on the naming of the column example:</p>
  
  <p>Table 1.<strong>Column 1</strong> will be Table 2.<strong>Column 1</strong>
  So detecting the column to update will be based on matching column names.</p>
  
  <p>Which row should be last row in table 2 + 1.</p>
  
  <p>So whatever the number of columns is there, function should search and match in table 2 based on column name.</p>
  
  <p>I don't need exact syntax, I just want to know the how would the logic go.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>This is an example:</p>
  
  <p>Image: <a href="http://gdurl.com/9sf5" rel="nofollow">http://gdurl.com/9sf5</a></p>
  
  <p>I will call the function like this:</p>
  
  <p>DynamicTableMigration(Table 1, Table 2)</p>
  
  <p>So the function will move all data in table 1 to table 2 matching columns based on identical column names like in the image example.</p>