Hypelink to hidden sheet

abugharibh

New Member
Joined
May 16, 2019
Messages
10
Hello,

i'm trying to creat a hyperlink to a hidden sheet within the same workbook so i've put in the following:

Dim shtName As String
shtName=Left(Target.Subaddress,InStr(1,Target.Subaddress,"!")-1)
Sheets(shtName).Visible=xlSheetVisible
Sheets(shtName).Select

it does not work unless the hyperlink is only one word.
e.g. hyperlink "click to view PDSA" OR "Click to view" and the sheet name is "PDSA Adult Pathway" does not work.

i cant make the names or the hyperlinks one word each because i have many that will end up with the same name.

Im i missing something?

thank you
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Try
VBA Code:
 shtName=Replace(Left(Target.Subaddress,InStr(1,Target.Subaddress,"!")-1),"'","")
 
Upvote 0
Solution
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,611
Messages
6,120,513
Members
448,967
Latest member
screechyboy79

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