Unhide/hide certain worksheets

cdsaroma

Board Regular
Joined
Feb 5, 2003
Messages
200
I have sheets numbered 1-107 and would like a macro that would unhide all these sheets, in one go. Then a macro to hide all the sheets again.
Is this possible?

thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Is this possible? ...Mostly
We can't hide all the sheets. At least one needs to remain visible.
That being said, here's a routine that will hide all but sheet 1, or show all sheets, depending on what's visible when you execute the code. (ie, it's just a toggle button.)
Code:
Sub ToggleHideSheets()
Dim WkSht As Integer
For WkSht = 2 To Sheets.Count
  With Sheets(WkSht)
    .Visible = Not .Visible
  End With
Next WkSht
End Sub

Is that close to what you're looking for?
 
Upvote 0
Is this possible? ...Mostly
We can't hide all the sheets. At least one needs to remain visible.
That being said, here's a routine that will hide all but sheet 1, or show all sheets, depending on what's visible when you execute the code. (ie, it's just a toggle button.)
Code:
Sub ToggleHideSheets()
Dim WkSht As Integer
For WkSht = 2 To Sheets.Count
  With Sheets(WkSht)
    .Visible = Not .Visible
  End With
Next WkSht
End Sub

Is that close to what you're looking for?

Yes, that is on the right track.
Is there a way to exclude these two sheets from being unhidden:
Value
Monthly
And when they (1 to 107) are unhidden is there a way to make sheet number "1" the active sheet

thanks a lot
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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