Hi I used to only surf over this site but now I am here with my problem in user form control
I have nearly 200 toggle buttons in a user form and I want half of them "Togglebutton1" to "Togglebutton100" will toggle between "Wall" and "Slab" and half of them "Togglebutton101" to "Togglebutton200" will toggle between "Unit-1" and "Unit-2". so for each buttons click from 1 to 100 will have a same code and 101 to 200 will have a same click action. I was just wondering if i have to assign individual click action for each togglebutton or is there any way to loop between them.
code is like this
I have nearly 200 toggle buttons in a user form and I want half of them "Togglebutton1" to "Togglebutton100" will toggle between "Wall" and "Slab" and half of them "Togglebutton101" to "Togglebutton200" will toggle between "Unit-1" and "Unit-2". so for each buttons click from 1 to 100 will have a same code and 101 to 200 will have a same click action. I was just wondering if i have to assign individual click action for each togglebutton or is there any way to loop between them.
code is like this
HTML:
'for togglebuttons 1 to 100
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = False Then
ToggleButton1.Caption = "Wall"
Else
ToggleButton1.Caption = "Slab"
End If
End Sub
'for togglebuttons 101 to 200
Private Sub ToggleButton101_Click()
If ToggleButton101.Value = False Then
ToggleButton101.Caption = "Unit-1"
Else
ToggleButton101.Caption = "Unit-2"
End If
End Sub