Hi,
I've got a code to unhide a tab when clicking on a hyperlink, before going to the cell indicated in the hyperlink. It works but every time that I introduce a number or so in any other cell in the workbook, the error "user-defined type not defined" shows up and it's annoying.
Code are:
Tab that does no gets hidden
"
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim strAddress As String
strAddress = Application.WorksheetFunction.Substitute(Target.SubAddress, "'", vbNullString)
ThisWorkbook.Worksheets(VBA.Left$(strAddress, VBA.InStr(1, strAddress, "!") - 1)).Visible = xlSheetVisible
Application.EnableEvents = False
Target.Follow
End Sub
"
Tab that gets hidden after clicking hyperlink to go to the tab above
"
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Me.Visible = xlSheetHidden
End Sub
"
Thanks
I've got a code to unhide a tab when clicking on a hyperlink, before going to the cell indicated in the hyperlink. It works but every time that I introduce a number or so in any other cell in the workbook, the error "user-defined type not defined" shows up and it's annoying.
Code are:
Tab that does no gets hidden
"
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim strAddress As String
strAddress = Application.WorksheetFunction.Substitute(Target.SubAddress, "'", vbNullString)
ThisWorkbook.Worksheets(VBA.Left$(strAddress, VBA.InStr(1, strAddress, "!") - 1)).Visible = xlSheetVisible
Application.EnableEvents = False
Target.Follow
End Sub
"
Tab that gets hidden after clicking hyperlink to go to the tab above
"
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Me.Visible = xlSheetHidden
End Sub
"
Thanks