Spartan300
Board Regular
- Joined
- Jul 1, 2008
- Messages
- 71
Hello,
I currently have the following code: -
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
ActiveWorkbook.Unprotect Password:="AmenhotepIV"
Sheets("Sheet1").Visible = False
For Each ws In ActiveWorkbook.Worksheets
If UCase(ws.Name) <> "SHEET1" Then ws.Visible = True
ActiveWorkbook.Protect Password:="AmenhotepIV"
Next ws
ThisWorkbook.Save
End Sub
And was wondering how I can have the code hide more than one tab if it is visable when the workbook is closed?
Many thanks
I currently have the following code: -
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim ws As Worksheet
ActiveWorkbook.Unprotect Password:="AmenhotepIV"
Sheets("Sheet1").Visible = False
For Each ws In ActiveWorkbook.Worksheets
If UCase(ws.Name) <> "SHEET1" Then ws.Visible = True
ActiveWorkbook.Protect Password:="AmenhotepIV"
Next ws
ThisWorkbook.Save
End Sub
And was wondering how I can have the code hide more than one tab if it is visable when the workbook is closed?
Many thanks