ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Unhide hidden sheets (https://www.excelbanter.com/excel-discussion-misc-queries/57247-unhide-hidden-sheets.html)

Minos

Unhide hidden sheets
 
I found that to unhide hidden sheets in Excel you have to do one by one or
sheet by sheet. Is there a way by which I can a select more than one sheet to
unhide and unhide them simultaneously instead of doing it one by one?


Minos

Dave Peterson

Unhide hidden sheets
 
You always have to have at least one sheet visible, but you could use code like
this:

Option Explicit
Sub UnhideAll()
Dim wks As Object
For Each wks In ActiveWorkbook.Sheets
wks.Visible = xlSheetVisible
Next wks
End Sub

Sub HideSelected()
Dim wks As Object
On Error Resume Next
For Each wks In ActiveWindow.SelectedSheets
wks.Visible = xlSheetHidden
If Err.Number < 0 Then
MsgBox wks.Name & " was not hidden"
Err.Clear
End If
Next wks
On Error GoTo 0
End Sub

The second procedure hides the sheets that are grouped--click on the first sheet
tab and ctrl-click on subsequent.


Minos wrote:

I found that to unhide hidden sheets in Excel you have to do one by one or
sheet by sheet. Is there a way by which I can a select more than one sheet to
unhide and unhide them simultaneously instead of doing it one by one?

Minos


--

Dave Peterson


All times are GMT +1. The time now is 05:09 AM.

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