VBA - MrExcel Podcast

Hoube78

New Member
Joined
Mar 27, 2014
Messages
43
Hi I came across the following podcast on YouTube for Mr Excel which had the following code:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
LinkTo = Target.SubAddress
WhereBang = InStr(1, LinkTo, "!")
If WhereBang > 0 Then
MySheet = Left(LinkTo, WhereBang - 1)
Worksheets(MySheet).Visible = True
Worksheets(MySheet).Select
MyAddr = Mid(LinkTo, WhereBang + 1)
Worksheets(MySheet).Range(MyAddr).Select
End If

End Sub

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
Worksheets("Menu").Select
Target.Parent.Worksheet.Visible = False
End Sub

However it only works when I use text hyperlink, every time I have a button /shape with a hyperlink it does not work and does not return any bug??

I basically plan to have a dashboard which has only one sheet visible to the user which contains a menu to other pages which are hidden. They access these pages through hyperlinks which are in the format of a shape / button.

Does the code need to change or can this be done another way?

Any help please.

Thanks,
John
 

Forum statistics

Threads
1,085,995
Messages
5,387,148
Members
402,045
Latest member
Hidalgo

Some videos you may like

This Week's Hot Topics

Top