title: VBA Variable as CommandButton#
body: <p>I'm rewriting some code and had a thought, but can't seem to get my syntax right to execute it properly.  I want to use a for loop to populate an array of commandbuttons as well as control their visibility.  I just need help with my syntax to define which CommandButton number I'm working on in the loop.  For instance, CommandButton1, CommandButton2, etc.</p>
  
  <pre><code>Public Sub LoadLots(sName As String, streamLots() As String)
      Label1.Caption = sName
      For o = 1 To 9
          If streamLots(o) &lt;&gt; "" Then
              CommandButton&amp; o &amp;.Caption = streamLots(o)
              CommandButton&amp; o &amp; .Visable = True
          Else
              CommandButton&amp; o &amp; .Visable = False
          End If
      Next
  End Sub
  </code></pre>