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.
 
I just made a new workbook for an example. Can I send this to you?
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
The example workbook I made is only 2 sheets and only has 2 hyperlinks on it. One to the hidden sheet and one on the hidden sheet to go back to the main page.
 
Upvote 0
You can upload a file to a share site such as OneDrive, GoggleDrive, mark it for sharing & post the link to the thread.
However judging by this
Ok, so that code is entered above the follow hyperlink code and the breakpoint is set on the hyperlink code.
You have not done what I said. Do not add that code to the hyperlink code, just run it on it's own from a normal module.
It is possible that events have been disabled & that code will reset it.
 
Upvote 0
I did insert a module to the Project checklist sheet and added that code but it is not working.

Here is the link to the example workbook.

 
Upvote 0
Sorry if I am miss understanding the direction you are providing me.
 
Upvote 0
Ok, thanks for the file. The reason it's not working is that you are not using a Hyperlink, but a shape.
Whilst you have attached a link to the shape, it's not the same as a hyperlink in cell.
You will either need to put a link in a cell & use your code, or remove the link from the shape & assign a macro to it.
 
Upvote 0
Ok so I will work on it in that direction. Thank you for the help and redirecting me in the correct place.
 
Upvote 0
You're welcome & thanks for the feedback.
If you get stuck just shout
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

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