title: Using variable for column reference in Excel VBA
body: <p>First off - I'm totally new to VBA. I'm trying to understand the syntax used to if I want to use a variable for the column header part of a range call. ex:</p>
  
  <pre><code>If up &lt;= Range("Table4[*variable*]")(i).Value Then
  </code></pre>
  
  <p>I'm passing the column name to the function as variable (byVal <em>variable</em> as String), but I get an error. If I use the actual column name all works great. Should I be using a different syntax?</p>