PDA

View Full Version : Looping through commands



DevanG
06-22-2011, 12:16 PM
If I were to have 10 commands: invest1, invest2, invest3, etc.
How could I run these through a loop to say, change their visibility?

for i = 1 to 10
cmdInvest & i.Visible = False
next i


Looks pretty amateur..

Bob Phillips
06-22-2011, 02:17 PM
For i = 1 To 10
activesheet.Buttons("Invest" & i).Visible = False
Next i