Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Ref a Group of Controls

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Ref a Group of Controls

Another way might be to put the related controls in a Frame

Me.Frame1.Visible = bVis

You could disguise the frame by removing its caption and setting its border
colour to same as the form.

Regards,
Peter T


"Abdul" wrote in message
ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Group controls stefantem[_13_] Excel Programming 3 January 11th 06 12:36 PM
Is it possible to group parts with controls? [email protected] Excel Discussion (Misc queries) 4 October 12th 05 11:10 PM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
Group Controls Jack D[_2_] Excel Programming 1 January 20th 04 03:27 AM
group name for form controls Edwin Merced Excel Programming 2 November 29th 03 12:45 AM


All times are GMT +1. The time now is 05:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"