inactiveUser214710
Board Regular
- Joined
- Apr 27, 2012
- Messages
- 171
Hi everyone
Please Help me
In my vba project, I have three togg buttons (Tog1, Tog2 and Tog3) whose purpose is to open and close specifically (textboxes and comboboxes).
Thus: Tog1 opens and closes textbox1 and combobox1 and blocks Tog2 and Tog3
Tog2 opens and closes textbox2 and combobox2 and blocks Tog1 and Tog3
Tog3 opens and closes textbox3 and combobox3 and blocks Tog1 and Tog2
The code I use is described below, which becomes very extensive depending on the amount of Togs and Textbox and combobox used.
The question is how to create a macro for this purpose.
Thank you.
Please Help me
In my vba project, I have three togg buttons (Tog1, Tog2 and Tog3) whose purpose is to open and close specifically (textboxes and comboboxes).
Thus: Tog1 opens and closes textbox1 and combobox1 and blocks Tog2 and Tog3
Tog2 opens and closes textbox2 and combobox2 and blocks Tog1 and Tog3
Tog3 opens and closes textbox3 and combobox3 and blocks Tog1 and Tog2
The code I use is described below, which becomes very extensive depending on the amount of Togs and Textbox and combobox used.
The question is how to create a macro for this purpose.
Thank you.
Code:
Private Sub Tog1_Click ()
If Tog1.Value = True Then
Tog2.Locked = True
Tog3.Locked = True
ElseIf Tog1.Value = False Then
Tog1.Locked = False
Tog2.Locked = False
End if
End Sub
Private Sub Tog2_Click ()
........
Private Sub Tog3_Click ()
.........