I would like to hide the current page that the user is looking at when they click a hyperlink within excel that takes them to a different worksheet within the same workbook. I tried using the following code
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
On Error GoTo Cleanup
ActiveSheet.Visible = False
Application.EnableEvents = False
Target.Follow
Cleanup:
Application.EnableEvents = True
End Sub
because I assumed the activesheet would be the sheet that the hyperlink is on and not the target sheet, however, ActiveSheet is the target sheet. Any suggestions on how to hide the partnet sheet?