I use this on my project. I hope I can explain it to you:
I have this:
to "force the use of macros I have a landing page named "Start". th code goes into thisworkbook
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Step 1: Declare your variables
Dim ws As Worksheet
'Step 2: Unhide the Starting Sheet
Sheets("START").Visible = xlSheetVisible
'Step 3: Start looping through all worksheets
For Each ws In ThisWorkbook.Worksheets
'Step 4: Check each worksheet name
If ws.Name <> "START" Then
'Step 5: Hide the sheet
ws.Visible = xlVeryHidden
End If
'Step 6: Loop to next worksheet
Next ws
'Step 7: Save the workbook
ActiveWorkbook.Save
End Sub
Private Sub Workbook_Open()
'Step 1: Declare your variables
Dim ws As Worksheet
'Step 2: Start looping through all worksheets
For Each ws In ThisWorkbook.Worksheets
'Step 3: Unhide All Worksheets
ws.Visible = xlSheetVisible
'Step 5: Loop to next worksheet
Next ws
'Step 6: Hide the Start Sheet
Sheets("START").Visible = xlVeryHidden
Sheets("SHEET!").Visible = xlVeryHidden
End Sub
This goes to the sheet you want to be active, or never hidden.
Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) LinkTo = Target.SubAddress
WhereBang = InStr(1, LinkTo, "!")
If WhereBang > 0 Then
MySheet = Left(LinkTo, WhereBang - 1)
Worksheets(MySheet).Visible = True
Worksheets(MySheet).Select
MyAddr = Mid(LinkTo, WhereBang + 1)
Worksheets(MySheet).Range(MyAddr).Select
End If
End Sub
This goes to all the sheets you want to be hidden (xlveryhidden)
Code:
Private Sub Worksheet_Deactivate()ThisWorkbook.Sheets("HIDDEN SHEET").Visible = False 'hide
End Sub
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Worksheets("ACTIVE SHEET NOT HIDDEN").Select
Target.Parent.Worksheet.Visible = False
End Sub
I hope this helps. I found the code online as well and came to adapted to my needs with time.
best regards,
eLy