LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Group controls

An example:

Private Sub CommandButton1_Click()
Dim group As New Collection
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox Then
group.Add ctrl, ctrl.Name
End If
Next
For i = 1 To group.Count
j = Int(Rnd() * group.Count + 1)
group(j).Value = group(i).Name
Next

msgbox Group("Textbox3").Value
End Sub



--
Regards,
Tom Ogilvy


"stefantem" wrote
in message ...

The textboxes are in an userform.

dim group1 as New Collection

group1.Add Item....

then refer the elements

How can I use this?


--
stefantem
------------------------------------------------------------------------
stefantem's Profile:

http://www.excelforum.com/member.php...o&userid=13594
View this thread: http://www.excelforum.com/showthread...hreadid=500081



 
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
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
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 10:46 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"