View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_579_] Leith Ross[_579_] is offline
external usenet poster
 
Posts: 1
Default Auto hide sheets


Hello tcbootneck,

Add the following code to your Workbook's Open event procedure.

Dim Wks As Worksheet
For Each Wks In ThisWorkbook.Worksheets
If Wks.Visible = xlSheetVisible Then Wks.Visible = xlSheetHidden
Next Wks

This will check each Worksheet and test if it is visible. If it is
visible then the macro will hide the Worksheet. Your final code result
will look like this...

Private Sub Workbook_Open()
Dim Wks As Worksheet
For Each Wks In ThisWorkbook.Worksheets
If Wks.Visible = xlSheetVisible Then Wks.Visible = xlSheetHidden
Next Wks
End Sub

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=553001