Excel VBA - Using checkboxes to hide/unhide worksheets

Shelby21

Board Regular
Joined
Nov 21, 2017
Messages
51
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I need some help with a spreadhseet I have been working on for months.
I'm not very good with VBA and don't think there is any other way to accomplish what I am trying to do below.

Any help would be much appreciated!

This spreadsheet has the following tabs:

DC_Info
Instructions
LP
IR_Setup
PASS
CR_Setup
IR_Teaching
CR_Teaching
Robot_Teaching_Verifications
Wafer_Slip_DCP's
KMTerm_Commands
SU3200_Shims
Revision_History

What I am trying to do:

The table below is located in the Instructions tab.

I would like to link each checkbox to its corresponding worksheet

Checking the box makes the worksheet visible

Unchecking the box hides the worksheet

I would also like to be able to center the checkboxes within column E and have solid border for the checkbox instead of just the two line bordered checkboxes shown below

If possible, a last item would be to highlight cell of the worksheet name yellow if the checkbox is checked.

setup.PNG
 
Hi Saura,

Thank you for your response on how to resolve the issue during worksheet protection.
I tried your method, but this isn't going to work for what I need.
Using that method unlocks the worksheet that is selected allowing the end user to view and modify formulas and cells, which I do not want.

The work around I came up with is to run a worksheet macro I put in that will protect all worksheets by pressing Ctrl + Shift + P
Once all worksheets are protected, I unprotect the Instructions tab that contains the checkboxes for all the other tabs.
Press protect worksheet and check the box for format cells, which is only applied to the Instructions tab.

Viola!

Everything is protected the way I want and the tab checkboxes are working as intended.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,591
Messages
6,120,431
Members
448,961
Latest member
nzskater

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