PDA

View Full Version : Accessing Hidden Sheets Via Hyperlink



Sarahbyrne
07-27-2017, 07:53 AM
Im not good at VBA at all.

I have read through some forums to figure it out and im still lost.

Ive created a spreadsheet which has 18 tabs, 1 being the master sheet which I have put in hyperlinks to go to the other sheets within.

I want to hide the other sheets and have them open on hyperlink and close after.

Please help me, im going to bang my head against a wall

Kenneth Hobs
07-27-2017, 08:48 AM
Welcome to the forum!

Right click your Master Sheet 1, View Code, and paste:

Private Sub Worksheet_Activate()
HideAll
End Sub


Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Application.EnableEvents = False
HideAll
Select Case Target.Name
Case "Sheet2!A1"
Sheets(Split(Target.Name, "!")(0)).Visible = xlSheetVisible
Target.Follow
Case Else
End Select
Application.EnableEvents = True
End Sub


Private Sub HideAll()
Dim i As Integer
For i = 2 To Sheets.Count
Sheets(i).Visible = xlSheetVeryHidden
Next i
End Sub




Add your hyperlink to sheet Cases to suit.