How to iterate through controls in VBA/Excel?
February 22, 2007 4:34 PM Subscribe
How do I loop through a bunch of controls using VBA in Excel 2003?
I have a sheet w/ a bunch of option buttons on it. I would like to be able to use a loop and set their values.
So,
I have a bunch of OBs named OptionButton1, OptionButton2, etc...
I want to do something like...
For i = 1 to 10
controls(OptionButton & 1).value = True
Next i
Unfortunately the collection "CONTROLS" seems to be available only in VB and not in VBA... Can someone help?
posted by apark to computers & internet (4 answers total)
For i = 1 to 10 Controls("optionbutton" & i).Value= True Next iposted by Doofus Magoo at 5:36 PM on February 22, 2007