ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I unhide multiple sheets at once? (https://www.excelbanter.com/excel-discussion-misc-queries/14844-can-i-unhide-multiple-sheets-once.html)

Brockli

Can I unhide multiple sheets at once?
 
Some of my Excel files contain many hidden sheets. When I want to make
changes to the hidden sheets, I have to individually unhide them and this
takes a long time. Is there a way to unhide all hidden sheets at once? This
would be a huge timesaver!

Ken Wright

How about a toggle that flips Visible to Hidden and vice versa

Sub ToggleHiddenSheets()
'If only selected sheets are to be hidden, then a toggle works well

Dim wkSht As Worksheet
Dim statStr As String
Dim cnt As Long
cnt = 0

For Each wkSht In ActiveWorkbook.Worksheets
If wkSht.Visible = False Then
cnt = cnt + 1
End If
Next wkSht

If cnt 0 Then
For Each wkSht In ActiveWorkbook.Worksheets
With wkSht
.Visible = Not .Visible
End With
Next wkSht

Else: MsgBox "You have no hidden sheets"
End If
End Sub

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Brockli" wrote in message
...
Some of my Excel files contain many hidden sheets. When I want to make
changes to the hidden sheets, I have to individually unhide them and this
takes a long time. Is there a way to unhide all hidden sheets at once?

This
would be a huge timesaver!





All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com