Using the following two subs to make all worksheets apart from the index page hidden, and then to make hidden sheets visible to hyperlinks so that I can have an index page which links to hidden tabs, as the database I'm managing is over 100 worksheets.
Private Sub Worksheet_Activate()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If InStr(1, ws.Name, "Infopages_001_Index", vbTextCompare) = 0 Then
ws.Visible = False
End If
Next ws
End Sub
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
With Worksheets(Target.Range.Value)
.Visible = True
.Activate
.Range("A1").Select
End With
End Sub
Is it possible to modify this line "Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)", to work so that when I run a macro it will look for hidden as well as visible sheets?
Private Sub Worksheet_Activate()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If InStr(1, ws.Name, "Infopages_001_Index", vbTextCompare) = 0 Then
ws.Visible = False
End If
Next ws
End Sub
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
With Worksheets(Target.Range.Value)
.Visible = True
.Activate
.Range("A1").Select
End With
End Sub
Is it possible to modify this line "Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)", to work so that when I run a macro it will look for hidden as well as visible sheets?