Grizlore
Active Member
- Joined
- Aug 22, 2006
- Messages
- 259
Hi All,
The code below works fine, apart from it will not hide charts, only sheets.
Upon closing, I need to hide everything (sheet and charts) and just leave "LOCKED" on display. When it opens, I need to see everything except "LOCKED"
Could anyone tell me the most efficient way to amend the code below to accomodate this please?
Suggestions appreciated !
The code below works fine, apart from it will not hide charts, only sheets.
Upon closing, I need to hide everything (sheet and charts) and just leave "LOCKED" on display. When it opens, I need to see everything except "LOCKED"
Could anyone tell me the most efficient way to amend the code below to accomodate this please?
Code:
Option Explicit
Sub Auto_close()
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.Name = "LOCKED" Then
wsSheet.Visible = xlSheetVisible
Else
wsSheet.Visible = xlSheetVeryHidden
End If
Next wsSheet
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
'/////////////////////////////////
Sub Auto_open()
Application.ScreenUpdating = False
Dim wsSheet As Worksheet
For Each wsSheet In ThisWorkbook.Worksheets
If wsSheet.Name <> "LOCKED" Then
wsSheet.Visible = xlSheetVisible
End If
Next wsSheet
Sheets("LOCKED").Visible = xlSheetVeryHidden
Application.ScreenUpdating = True
End Sub
Suggestions appreciated !