title: Reference a table column by variable
body: <p>This should be simple, but I'm a VBA noob.  I've read lots of forums, and found nothing but overly complicated code that I couldn't decipher to fit my application.</p>
  
  <p>In Excel 2007 I have a Table already defined.  I can't post a picture because I am new to the forum, but the table has 3 columns, with header rows named 1 through 3, and one data row as crudely shown below:</p>
  
  <pre><code>Table1
  +------+------+-------+
  |1     |  2   |   3   |
  +------+------+-------+
  |Alpha |Bravo |Charlie|
  +------+------+-------+
  </code></pre>
  
  <p>With this simple Table the following works, and returns the text "Alpha".</p>
  
  <pre><code>Sub works()
  
      Dim item As String
  
      Sheets("Sheet1").Select
      item = ActiveSheet.Range("Table1[1]")
      MsgBox (item)
  
  End Sub
  </code></pre>
  
  <p>But I want to be able to refer to table column headers with an adjustable variable.  Why doesn't this work:</p>
  
  <pre><code>Sub doesntwork()
  
      Dim item As String
      Dim i As String
  
      i = 1
      Sheets("Sheet1").Select
      item = ActiveSheet.Range("Table1[i]")
      MsgBox (item)
  
  End Sub
  </code></pre>
  
  <p>It's got to be a syntax thing, but I'm having no luck sorting through all the various iterations of VBA syntax in the last 10+ years...</p>
  
  <p>Please help!  Thanks.</p>