title: Using string functions to indicate member of an enumeration in VBA
body: <p>I have to copy some data from one table to another. There are several groups of columns that are the same except for a name at the start of the column header.  I want to put those names into an array, and then loop through the groups doing the same operations on each group. I'd like to do this using an enumeration of the headers, but I can't find a way to reference the members of the enumeration by concatenating the name and the remainder of the header.  Boiling it down to the essentials, the code would look like this:</p>
  <pre><code>Enum Headers
  a1 = 1
  b1
  c1
  End Enum
  
  Sub test()
  Dim Pick() As Variant
  Pick = Array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;)
  For i = 1 To 3
      n = Headers.Concat(Pick(i), &quot;1&quot;)
      MyTable.DataBodyRange.Cells(Row, n) = OtherTable.DataBodyRange.Cells(Row, n)
  Next i
  End Sub
  </code></pre>
  <p>I know how to work around this, using a slightly different approach, and that's what I think I'll end up doing.</p>
  <pre><code>MyTable.ListColumns(Pick(i) &amp; &quot;1&quot;).DataBodyRange.Cells(Row,0)
  </code></pre>
  <p>That works because the column reference is to a string, so I can piece the string together in that fashion.</p>
  <p>But I wanted to know if anyone has a way to use something akin to what I outlined above using an enumeration.</p>