S
stefantem
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
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