inactiveUser214710
Board Regular
- Joined
- Apr 27, 2012
- Messages
- 171
Hello everyone
I have a macro below to open and close toggleButton (Tog1; Tog2; Tog3), only one at a time, in userform1.
[
How to add in the same macro, or another, the code, for the purpose of the title of Tog1, Tog2 or Tog3, pass to the worksheet its name (tog1.caption).
Thank you very much
I have a macro below to open and close toggleButton (Tog1; Tog2; Tog3), only one at a time, in userform1.
Code:
"MODULE"
Sub TogClick (tog as ToggleButton)
Col collection static like
Dim ctl as control
Dim vCtl as variant
If col is nothing then
Set col = New Collection
For each ctl in UserForm1.Controls
If TypeName (ctl) = "ToggleButton" Then col.Add ctl
Next ctl
End if
End Sub
'=====
Private Sub Tog1_Click () 'title " CAIXA "
TogClick Tog1 'Macro
End Sub
Private Sub Tog2_Click () 'title " BANK_1 "
TogClick Tog2 'Macro
End Sub
Private Sub Tog2_Click () 'title " BANK_2 "
TogClick Tog2 'Macro
End Sub
How to add in the same macro, or another, the code, for the purpose of the title of Tog1, Tog2 or Tog3, pass to the worksheet its name (tog1.caption).
Thank you very much