Hyperlink to Hidden Sheet

IDAK

New Member
Joined
Mar 5, 2020
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
Hello all,

Can someone help me out? I am still a noob to the VBA coding but I am having issues with getting my Hyperlinks to work to a hidden sheet.

My main sheet "Project Checklist" has four hyperlinks on it directing it to a Hidden sheets one of those sheets is the " Alarm Check Process" sheet. When the sheet is hidden the hyperlinks no longer work.

My "Alarm Check Process" sheet does have a simple code on it to hide the page once you navigate away from it and it works. This code is as follows:

Private Sub Worksheet_Deactivate()
Me.Visible = xlSheetHidden
End Sub


I have tried using this code below on the "Project Checklist" sheet but I can not seem to get it to work.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Dim ShtName As String
ShtName = Left(Target.SubAddress, InStr(1, Target.SubAddress, "!") - 1)
Sheets(ShtName).Visible = xlSheetVisible
Sheets(ShtName).Select
End Sub


Can someone help me and tell me what I might be doing wrong?

Thank you in advance.
 
Yes I tried that as well and it still does not work.
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
When I add a watch to the target my target window under value tab shows out of context.

Watch : : Target : <Out of context> : Hyperlink : Sheet2.Worksheet_FollowHyperlink
 
Upvote 0
I did click the hyperlink after inserting the break point and it does not work.

Now I added a watch to the target and other items and it shows under the value column Out of context or expression not defined in context.

Watch : : Target : <Out of context> : Hyperlink : Sheet2.Worksheet_FollowHyperlink

Watch : : ShtName : <Out of context> : Empty : Sheet2.Worksheet_FollowHyperlink

Watch : : SubAddress : <Expression not defined in context> : Empty : Sheet2.Worksheet_FollowHyperlink
 
Upvote 0
When you clicked on the hyperlink, did the code window open up with the breakpoint line highlighted in yellow?
 
Upvote 0
Ok, run this code & then try again
VBA Code:
Sub ResetEvents()
Application.EnableEvents = True
End Sub
 
Upvote 0
Ok I have placed that code at the top of the page and selected run. It appears to have run.

I can use the debug on that code and get each step to highlight as expected but once it continues to the next code I have it does nothing.
 
Upvote 0
I saved it and closed visual basic and selected the hyperlink and it does not work.
 
Upvote 0
Just run that code on it's own & then try clicking the hyperlink, with the breakpoint set.
 
Upvote 0
Ok, so that code is entered above the follow hyperlink code and the breakpoint is set on the hyperlink code.

I saved it and closed the VB and selected the hyperlink and still nothing happens.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top