I'm using the below code to hyperlink to hidden sheets, then re-hiding the sheet when done. Within the hyperlink sheet, I have six hyperlinks, but only four function as intended despite using the same VBA code. of the two that don't work, one refuses to open, but will auto hide if it is manually unhidden. The other one opens but not before returning a "Run-time error '13': Type mismatch", but will not auto hide when done. Any help would be greatly appreciated, because this is driving me a bit insane trying to figure out where I went wrong. If it helps the four hyperlinks that work are labeled GCS_70; GCS_71; GCS_72; and GCS_73. The one that will not open, but will auto hide if manually unhidden is labeled GSC_Audit. and the hyperlink that will work, but won't auto hide is SCC_Audit. Thanks again.
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
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