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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,790
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,344
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!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,163
Messages
5,835,742
Members
430,384
Latest member
kiuwai

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