Hide Sheets in the Work book....

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

Hi All,

I would want to hide all the sheets while the work sheet is
opening, i.e assuming from the second sheet in the workbook in a loop
till the last sheet in the workbook. Can any one please help me....
 
Raj,

You can't hide all the sheets in a workbook so in this macro pick the name
of a single sheet to leave visible.

Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
If wSheet.Name <> "Sheet1" Then
wSheet.Visible = xlVeryHidden 'Change to True to unhide
End If
Next wSheet
End Sub

Mike
 
Raj,

You can't hide all the sheets in a workbook so in this macro pick the name
of a single sheet to leave visible.

Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
If wSheet.Name <> "Sheet1" Then
wSheet.Visible = xlVeryHidden 'Change to True to unhide
End If
Next wSheet
End Sub

Mike






- Show quoted text -

ok... thx.........
 
Back
Top