Hide multiple worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello If I select multiple sheets in a workbook then select hide it only
hides one worksheet , therefore I have to repeat the process several time .
Is thre an easier way ? thanks
 
You can do it with a macro like the one below which goes through all the
worksheets in a workbook and asks if you want to hide it. Just one note you
cannot hide all worksheets in a workbook so if you try with this macro it
will throe an error.

Sub hideSheets()
Dim sSheetName As String
Dim sMessage As String
Dim Msgres As VbMsgBoxResult

For Each wsSheet In ActiveWorkbook.Worksheets
If wsSheet.Visible = True Then
sSheetName = wsSheet.Name
sMessage = "Hide the following sheet?" _
& vbNewLine & sSheetName
Msgres = MsgBox(sMessage, vbYesNo)
If Msgres = vbYes Then wsSheet.Visible = False
End If
Next wsSheet
End Sub
 
Hi;

Do the following:

1. Press CTRL and click on each Worksheet to group.
If you click on any selected sheet they will get deseleted. Selecting all
the sheets will form a group pf seleted sheets, for perfoming other task like
Hide, Unhide or renaming sheet. One way to find out whether you are able to
successfuly group your sheet , is to right-click the mouse button to view the
UnGroup Sheets option displayed in the popup menu.

2. On the Format menu, point to Sheet, and then click Unhide.

Important; When you want to unhide the worksheet, you will not be able to
unhide all the sheet at a time. You have unhide the sheets individually.
Therefore decide how many sheet you would prefer to be grouped before hinding
them.

Challa Prabhu
 
Sorry. for missing this important information.

Note: You cannot hide all the sheets in a Workbook. The following error
message will display if you attempt all the worksheet from the workbook:

"A workbook must contain at least one visible worksheet".

Challa Prabhu
 
Back
Top