B
bondie
Hi there!
I have a macro that hides sheets and does not save changes. When macro
are enabled, all hidden sheets will be displayed but user will not b
able to save any changes made to it. When I clicked Disable Macros, th
hidden sheets are still displayed. Why is that so? How can I make th
sheets hidden when macros are disabled?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
HideData
ThisWorkBook.Saved = True
End Sub
Private Sub Workbook_Open()
UnhideData
End Sub
Sub HideData()
Dim i As Byte
Sheets("Secure").Visible = True
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "Secure" Then
Sheets(i).Visible = xlVeryHidden
End If
Next i
End Sub
Sub UnhideData()
Dim i As Byte
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "Secure" Then
Sheets(i).Visible = True
End If
Next i
Sheets("Secure").Visible = xlVeryHidden
End Sub
Thanks in advance
I have a macro that hides sheets and does not save changes. When macro
are enabled, all hidden sheets will be displayed but user will not b
able to save any changes made to it. When I clicked Disable Macros, th
hidden sheets are still displayed. Why is that so? How can I make th
sheets hidden when macros are disabled?
Private Sub Workbook_BeforeClose(Cancel As Boolean)
HideData
ThisWorkBook.Saved = True
End Sub
Private Sub Workbook_Open()
UnhideData
End Sub
Sub HideData()
Dim i As Byte
Sheets("Secure").Visible = True
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "Secure" Then
Sheets(i).Visible = xlVeryHidden
End If
Next i
End Sub
Sub UnhideData()
Dim i As Byte
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "Secure" Then
Sheets(i).Visible = True
End If
Next i
Sheets("Secure").Visible = xlVeryHidden
End Sub
Thanks in advance