Create hyberlink to sheets based on matching text

dancingdata

New Member
Joined
Aug 18, 2017
Messages
6
I have a range of cells which will look as below in the main sheet:

1.1.1-ABC
1.1.2-CDE
1.1.3-EFG


Other sheets name: 1.1.1 , 1.1.2 & 1.1.3

I want a formula to retrieve the numbering text in main sheet and create a hyperlink that match with the text value. So If I clicked on 1.1.1-ABC for example it will go to 1.1.1.

I need to achieve this for a big list of outline numbering

Any ideas?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Assuming the split is always sheetName-somethingelse, then

Code:
Sub Macro1()
Dim lst As Long
Dim i As Long
Dim cellSplit() As String
lst = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To lst
    cellSplit() = Split(Range("A" & i).Value, "-")
    Sheet1.Hyperlinks.Add Range("A" & i), "", cellSplit(0) & "!A1"
Next i
End Sub

Make sure and test it on a copy/test workbook.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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