Check (Option) Button, checked and unchecked Event

Harley78

Active Member
Joined
Sep 27, 2007
Messages
369
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
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,056
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Code:
Sheets("4716-Telescoping Interface").Visible = BBH_4716.Value
should work.
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
How about

Private Sub BBH_4716_Click()
Sheets("4716-Telescoping Interface").Visible = BBH_4716.Value = TRUE
End Sub
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,216
Office Version
  1. 365
Platform
  1. Windows
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.
 

Harley78

Active Member
Joined
Sep 27, 2007
Messages
369
Thanks All, I knew it had to be simple...

I appreciate all your help!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,207
Messages
5,594,843
Members
413,944
Latest member
3xc3ln00b

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
Top