title: Setting Column Headers When Adding Columns To a Table Via Macro in Excel
body: <p>So I'm working on this macro that automatically adds columns to a table based on other columns in the table.  So here's the functionality:</p>
  
  <p>I have a number of columns in this table headed "CY 2010" - "CY 2020".  These years will inevitably change.  I then want to add a column to the table for each "CY" column.  Furthermore, I'd like the headers of these columns to match the year, but say "Content Volume YEAR"</p>
  
  <p>currently, I have the following code that adds columns appropriately:</p>
  
  <pre><code>Sub AddContentValueColumns()
  '
  ' AddContentValueColumn Macro
  ' Adds yearly vehicle content value columns to Propulsion data table.
  '
  
  '
      last = [A1].Value               ' cell contains number of "CY" columns in sheet
  
  '   Debug.Print (last)
  
      For Count = 1 To last
          Dim oSh As Worksheet
          Set oSh = ActiveSheet
          oSh.ListObjects("PropTable").ListColumns.Add
      Next Count
  
  End Sub
  </code></pre>
  
  <p>This works to add the columns, but it currently just adds the columns to the end of the table labeled as "CY 2021", etc.</p>
  
  <p>So how do I modify that code above to name the columns?</p>
  
  <p>Thanks.</p>
  
  <p>-Sean</p>