ToggleButton1.Address/Position/Row?

mos

New Member
Joined
May 8, 2011
Messages
15
I try to hide the worksheet with the string-value of column "MM".

iczFos.png


So I need the row where the Button is located.
I cannot find any feature of ToggleButton like location, position, address to get to the row.

Can someone give me a hint?

Code:
Private Sub ToggleButton1_Click()
    client = Cells(ToggleButton1.Row, 1).Text
    If ToggleButton1.Value = True Then
        show (client)
    Else
        hide (client)
    End If
End Sub

Sub show(client)
    Sheets(client).Hidden = False
End Sub

Sub hide(column)
    Sheets(client).Hidden = True
End Sub


Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Code:
Private Sub ToggleButton1_Click()
    client = Cells(ToggleButton1.[B]TopLeftCell[/B].Row, 1).Text
    If ToggleButton1.Value = True Then
        show (client)
    Else
        hide (client)
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top