Ref a Group of Controls
Put a distinctive set of characters in the names of the controls you
want to make not visible, such as zz, so rename textbox1 textboxzz1,
for instance, and so on. Then you can refer to them like this:
Dim ctrl As Control
For Each ctrl In Controls
If InStr(ctrl.Name, "zz") 0 Then ctrl.Visible = False
Next ctrl
James
Abdul wrote:
How i can refer a group of controls?
for eg. in mu userform when clicking a button i have to hide a few
labels, textboxes and comboboxes.
instead of saying textbox1 visible =false and combobox1 visible =false
etc to refere each control is there a way I can group them and refer
them in a single line?
thanks
|