VBA to Hide/Unhide sheets based on cell value

SnapwireMan

New Member
Joined
Jan 23, 2008
Messages
10
I have a workbook which has roughly 50 sheets. What I'm trying to do is automatically hide/unhide sheets based on the cell values in the first sheet. So in sheet1 cell A1 i would a value of FALSE which would trigger sheets1, 2, & 3 to hide, when that value changes to TRUE then those same sheets would unhide. I need to replicate that for the 10 corresponding sets of sheets, but for each grouping of sheets a different cell in sheet1 would be the trigger, cell A2 = sheets 4 - 10, cell A3 = sheets 11 - 20, etc. Any help on the VBA code would be greatly appreciated. Thanks everyone!
 
This discussion is absolutely awesome. It sounds so close to what I want to try to do. I am a total dweeb/newb to this forum. I've used excel for many years, but only got very serious and learned to use stuff like conditional formats and =IF formulae this week.

Would you indulge me in another, even simpler discussion of how I would implement this very idea?

Here's what I am trying to do:

Sheet 1 has a series of cells, say, B4 to B65, each of which can accept a value of 0 or 1. Setting B4 to 1 puts that value into cell B2 on sheet 2. Putting it into B5 puts it into cell B2 of sheet 3, and so on. As you go down the list entering 1s, each one inserts the value into a corresponding sheet.

I want to be able to go down the list on sheet 1, and enter a 1 or zero into one of those cells, B4 through B65, and have the corresponding worksheet tab appear or disappear.
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,215,221
Messages
6,123,699
Members
449,117
Latest member
Aaagu

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