View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
stefantem[_15_] stefantem[_15_] is offline
external usenet poster
 
Posts: 1
Default Collection as parameter


Problem:
In UserForm1 I have TextBox1, TextBox2, CommandButton1 and
CommandButton2.

Private Sub CommandButton1_Click()
Call test(1)
End Sub

Private Sub CommandButton2_Click()
Call test(2)
End Sub

In Module1 I declare two collections:

dim group1, group2 as New Collection

Public Sub test (a As Integer)
group1.Add UserForm1.TextBox1, "g1"
group2.Add UserForm1.TextBox2, "g2"

''I want to put in TextBox1 or TextBox2 value 1
''and I want to use collection of controls

group & i (1).Value="1" "is not correct but I need a solution for that

End Sub


--
stefantem
------------------------------------------------------------------------
stefantem's Profile: http://www.excelforum.com/member.php...o&userid=13594
View this thread: http://www.excelforum.com/showthread...hreadid=501008