-
put this in the ThisWorkbook code module
[vba]
Option Explicit
'
Private Sub Workbook_Open()
'
Call HideSheets
'
End Sub
'
Private Sub HideSheets()
'
Dim Sheet As Object '< Includes worksheets and chartsheets
'
Sheets("Sheet1").Visible = xlSheetVisible
'
For Each Sheet In Sheets
'change name to suit
If Not Sheet.Name = "Sheet1" Then
Sheet.Visible = xlSheetVeryHidden
End If
Next
'
End Sub
[/vba]
Put this in a standard module (call it from the Macro dialog box)
[vba]
Option Explicit
Sub UnhideSheet()
'
Dim ThisSheet As String
'
ThisSheet = ActiveSheet.Name
If Application.Dialogs(xlDialogWorkbookUnhide).Show = True Then
Sheets(ThisSheet).Visible = xlVeryHidden
End If
'
End Sub
[/vba]
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules