View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Martin Martin is offline
external usenet poster
 
Posts: 336
Default Groups of controls

They're a bit inconsistent(!) in Office - in some apps you can talk about the
collection of all Controls while in others you have to be more specific
(TextBoxes, CheckBoxes, Buttons, etc). As far as I can see, Excel forms are
the latter but you can still save time by using a For...Each loop and
hopefully you haven't got too wide a selection of different types of control.
For example, the following will cycle around all checkboxes making them
False (you could use an If, perhaps with myChk.Name, to be more specific):

Dim myChk As CheckBox
For Each myChk In ActiveSheet.CheckBoxes
myChk.Value = False
Next myChk



"FB" wrote:

I use different groups of controls in an excel sheet.
Each time a control in one group is clicked, I would like the controls
of the other groups to turn to "False".
I know how to code it control after control, but this is quite tedious!
Is ther any kind of code that could go "For all controls in group X,
when control is clicked, value of all controls in group Y and Z go to
False" ?
Thanks in advance,
Franck