Hyperlink Query

gordsky

Well-known Member
Joined
Jun 2, 2016
Messages
556
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

Sorry if this is a basic question but ive been stumped for a day or so trying various things.

I have a workbook that has numerous sheets all of which the most recent are hidden.
I have created an archive tab and indexed all the hidden sheets with a hyperlink to them so a user can click on the link and view the sheet.
to do this I use a piece of code in the "Archive" sheet code as follows

VBA Code:
Private Sub Worksheet_FollowHyperlink(ByVal target As Hyperlink)
Dim ws As Worksheet
Set ws = sheets(target.name)
ws.Visible = True
ws.Activate
End Sub

This works great as it is however i wanted to make the hyperlink names more friendly/obvious so changed the display names. the links now dont work and Im guessing its due to the target.name/display name not being the sheets name so how do i modify that line of code to set the worksheet to be hyperlink address rather than the display name.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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