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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
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,226,113
Messages
6,189,046
Members
453,522
Latest member
Seeker2025

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