title: How to pull cell values from Excel document into HTML table with VBA Macro with ForEach Loop
body: <p>I'm looking to create an Excel macro with VBA that generates an HTML table for a weekly webpage update. The table is quite large and several of the table cells are link values. My research has lead me thus far.</p>
  
  <pre><code>Sub Export_AB_Table()
  
    For Each Row In Rows
  
      valA = ("A" &amp; ActiveCell.Row)
      valB = ("B" &amp; ActiveCell.Row)
      valC = ("C" &amp; ActiveCell.Row)
      valE = ("E" &amp; ActiveCell.Row)
      valG = ("G" &amp; ActiveCell.Row)
      valI = ("I" &amp; ActiveCell.Row)
  
      tableHTML = "&lt;body&gt;&lt;tbody&gt;"
      tableHTML = "&lt;tr&gt;&lt;td&gt;"
  
      valE
  
      tableHTML = "&lt;/td&gt;&lt;td&gt;"
  
      valA valB
  
      tableHTML = "&lt;/td&gt;&lt;td&gt;"
  
      Val
  
      tableHTML = "&lt;/td&gt;&lt;/tr&gt;"
      tableHTML = "&lt;/tbody&gt;&lt;/body&gt;"
  
  Next table_cell
  End Sub
  </code></pre>
  
  <p>I'm wanting to run through the 6 column table and, for each row, pull out several table cell values, inserting them into HTML table row string. The table would then export an HTML doc. I can export the table, it's the pulling values into the table for each row that I can't find a write-up on.</p>
  
  <p>The current issue is my value reference. Can anyone advise or point me in the direction of a tutorial or resource for something close to my desired goal? Any help is appreciated.</p>