Force Macro

  • Thread starter BNT1 via OfficeKB.com
  • Start date
B

BNT1 via OfficeKB.com

Hi

Just a query. Got the following force macro off this forum. when the macro
is not enabled, the "warning" sheet is visible, plusall the graph sheets i
have in the workbook. The data sheets are hidden

FYI - there are other macro for enabling grouping.(not sure if relevant)

can the graphs also be hidden?

regards

Brian

Private Sub Workbook_Open()
Application.ScreenUpdating = False
For i = 1 To Worksheets.Count
Sheets(i).Visible = True
Next i
Sheets("Warning").Visible = xlVeryHidden
Application.ScreenUpdating = True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
For i = 1 To Worksheets.Count
Sheets("Warning").Visible = True
If Sheets(i).Visible = True And Sheets(i).Name <> "Warning" Then
Sheets(i).Visible = xlVeryHidden
End If
Next i
Application.DisplayAlerts = False
ActiveWorkbook.Save
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top