Check (Option) Button, checked and unchecked Event

Harley78

Active Member
Joined
Sep 27, 2007
Messages
372
Office Version
  1. 365
Platform
  1. Windows
I am sure its a simple code but can't seem to work it out, but here it goes anyway.

I have a userform with 32 Checkboxes. All of my worksheets are hiden. I do have a very simple code to open when checked, However, I have been trying to figure out the opposite. When Unchecked, it will hide the worksheet.


Private Sub BBH_4716_Click()
Sheets("4716-Telescoping Interface").Visible = True
End Sub


Can anyone tell me what this idiot is missing or point me in the right direction

Thanks
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Code:
Sheets("4716-Telescoping Interface").Visible = BBH_4716.Value
should work.
 
Upvote 0
How about

Private Sub BBH_4716_Click()
Sheets("4716-Telescoping Interface").Visible = BBH_4716.Value = TRUE
End Sub
 
Upvote 0
How about not having 32 checkboxes in the first place?:)

You could easily list the sheets in a listbox or combobox.

And if you really want checkboxes appropriate properties can be set to do that.
 
Upvote 0
Thanks All, I knew it had to be simple...

I appreciate all your help!
 
Upvote 0

Forum statistics

Threads
1,213,483
Messages
6,113,919
Members
448,533
Latest member
thietbibeboiwasaco

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