VBA Variable as CommandButton#
问题 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. Public Sub LoadLots(sName As String, streamLots() As String) Label1.Caption = sName For o = 1 To 9 If streamLots(o) <> "" Then CommandButton& o