hyperlink to hidden sheet code not working

PureBluff

Board Regular
Joined
Apr 4, 2014
Messages
174
Office Version
  1. 2016
Platform
  1. Windows
  2. Mobile
Hi all,

At one point this code was working and now it's not .... As it's a worksheet_event and I am self taught, I get no error (maybe theres a way to see an error code in a ws.event?)

Anyway, My plan was to hide some user specific sheets yet create an index page that allows you to unhide them at a click of a button.... As I say, this did work at one stage but now the sheets only activate if they're visible. :/

The code I used was:

Rich (BB code):
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 
    
   Dim strSheet As String 
     
   If InStr(Target.Parent, "!") > 0 Then 
      strSheet = Left(Target.Parent, InStr(1, Target.Parent, "!") - 1) 
   Else 
      strSheet = Target.Parent 
   End If 
    
   Sheets(strSheet).Visible = True 
   Sheets(strSheet).Select 
    
End Sub 
Private Sub Worksheet_Activate() 
    
   Dim ws As Excel.Worksheet 
    
   For Each ws In ThisWorkbook.Worksheets 
      ws.Visible = (ws.Name = Me.Name) 
   Next 
    
End Sub  

[FONT=source_sans_proregular]

The hyperlinks being in sheet "overview"

link =
[FONT=source_sans_proregular]https://mega.nz/#!1pxGnSbR!PTRbBQA_L0toGxOkk8ja_4RxtORXTpYcKnAI77eNslc[/FONT][FONT=source_sans_proregular]

Can someone assist? Thanks
[/FONT]
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
EnableEvents had been set to false, that's why it stopped working!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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