title: Dynamically populate Excel table from cell values from different worksheets with VBA
body: <p>I want to populate a <code>table</code> in one Excel sheet with information from different <code>cells</code> from a different <code>sheet</code> in the same <code>workbook</code>. Once the table is populated, the user clears the data with a macro (already working) and fill in the <code>sheet</code> with new data to be used to add extra rows to the same table, with the same macro used before.</p>
  <p>What I want exactly to reproduce is the table in the image below.</p>
  <p><a href="https://i.stack.imgur.com/SoNmo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SoNmo.png" alt="enter image description here" /></a></p>
  <p>I have tried using the following code without success:</p>
  <pre><code>Sub saveEvent()
  
     Dim resultsSht As Worksheet
     Dim lngDestLrow As Long
      
     'Define Worksheets
     Set resultsSht = Sheets(&quot;Results&quot;)
     Set DestSht = Sheets(&quot;ResultsDB&quot;)
     
     'Define Destination Sheet Lrow
     lngDestLrow = DestSht.Cells(Rows.Count, &quot;A&quot;).End(xlUp).Row
     
     'Move Data
     DestSht.Cells(lngDestLrow + 0, &quot;A&quot;) = resultsSht.Range(&quot;C9&quot;) 'Enter the form Field A on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;B&quot;) = resultsSht.Range(&quot;C10&quot;) 'Enter the form Field B on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;C&quot;) = resultsSht.Range(&quot;C11&quot;) 'Enter the form Field C on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;D&quot;) = resultsSht.Range(&quot;C12&quot;) 'Enter the form Field D on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;E&quot;) = resultsSht.Range(&quot;C13&quot;) 'Enter the form Field E on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;F&quot;) = resultsSht.Range(&quot;C14&quot;) 'Enter the form Field F on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;G&quot;) = resultsSht.Range(&quot;C15&quot;) 'Enter the form Field G on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;H&quot;) = resultsSht.Range(&quot;B23&quot;) 'Enter the form Field H on the next available row
     'DestSht.Cells(lngDestLrow + 1, &quot;I&quot;) = resultsSht.Range(&quot;B24&quot;)
     'DestSht.Cells(lngDestLrow + 1, &quot;J&quot;) = resultsSht.Range(&quot;C24&quot;)
  
  End Sub
  
  
   
  </code></pre>