ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Sheets in the Work book.... (https://www.excelbanter.com/excel-programming/393497-hide-sheets-work-book.html)

Raj[_11_]

Hide Sheets in the Work book....
 
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....


Mike H

Hide Sheets in the Work book....
 
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" wrote:

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[_11_]

Hide Sheets in the Work book....
 
On Jul 17, 3:54 pm, Mike H wrote:
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" wrote:
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....- Hide quoted text -


- Show quoted text -


ok... thx.........



All times are GMT +1. The time now is 03:32 PM.

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