Hello,
I am using the following code to unhide a sheet when accessed through a hyperlink and rehide the sheet when I return to my workbook index:
When I click any hyperlinks in the index, I get a "Reference isn't valid" error, but when I click OK it unhides the sheet and takes me there as it should.
When I go back to the index it hide the sheet as normal.
Any clues from the MrExcel hivemind?
Thank you,
Jon
I am using the following code to unhide a sheet when accessed through a hyperlink and rehide the sheet when I return to my workbook index:
VBA Code:
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Application.ScreenUpdating = False
Dim strLinkSheet As String
If InStr(Target.Parent, "!") > 0 Then
strLinkSheet = Left(Target.Parent, InStr(1, Target.Parent, "!") - 1)
Else
strLinkSheet = Target.Parent
End If
Sheets(strLinkSheet).Visible = True
Sheets(strLinkSheet).Select
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Activate()
On Error Resume Next
Sheets(ActiveCell.Value2).Visible = False
End Sub
When I click any hyperlinks in the index, I get a "Reference isn't valid" error, but when I click OK it unhides the sheet and takes me there as it should.
When I go back to the index it hide the sheet as normal.
Any clues from the MrExcel hivemind?
Thank you,
Jon