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.
 

IDAK

New Member
Joined
Mar 5, 2020
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
I just made a new workbook for an example. Can I send this to you?
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

IDAK

New Member
Joined
Mar 5, 2020
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
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.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,757
Office Version
  1. 365
Platform
  1. Windows
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.
 

IDAK

New Member
Joined
Mar 5, 2020
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
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.

 

IDAK

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

ADVERTISEMENT

Sorry if I am miss understanding the direction you are providing me.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,757
Office Version
  1. 365
Platform
  1. Windows
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.
 

IDAK

New Member
Joined
Mar 5, 2020
Messages
17
Office Version
  1. 2016
Platform
  1. Windows
Ok so I will work on it in that direction. Thank you for the help and redirecting me in the correct place.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
52,757
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
If you get stuck just shout
 

Watch MrExcel Video

Forum statistics

Threads
1,122,246
Messages
5,595,044
Members
413,963
Latest member
teggl97

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
Top