HotNumbers
Well-known Member
- Joined
- Feb 14, 2005
- Messages
- 732
How do I Very Hide a worksheet on close? I have VB that is run that unhide worksheets I want the ability to automatically very hide specific sheets if they are left visible?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim i As Long
For i = 1 To Worksheets.Count
If Worksheets(i).Visible = -1 Then
Worksheets(i).Visible = 2
End If
Next i
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.DisplayAlerts = False
Worksheets("Master Table").Visible = xlSheetVeryHidden
ThisWorkbook.Save
Application.DisplayAlerts = True
End Sub