Thread: Force Macro
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
BNT1 via OfficeKB.com BNT1 via OfficeKB.com is offline
external usenet poster
 
Posts: 125
Default Force Macro

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

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200906/1