Hyperlink doesn't work with INDEX/MATCH function as friendly name

Ferty

New Member
Joined
Jan 22, 2020
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hello,
I found problem with my HYPERLINK and really couldn't find solution for that.

I have workbook with few Sheets, one of them is my source data which includes hyperlinks with friendly names and without.
I have problem when i try use one of data with hyperlink covered by friendly name.

I extract the link from hyperlink with function:

VBA Code:
Function GetUrl(WorkingRng As Range) As String

GetUrl = WorkingRng.Hyperlinks(1).Address

End Function

and my function looks like this:
=HYPERLINK(GetUrl(INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))),INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0)))

and this doesn't work.

When i change friendly name part:
Rich (BB code):
INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))

to :
"SOME TEXT"

it works.

When i use only:
Rich (BB code):
=HYPERLINK(GetUrl(INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))))

it works, but i need friendly name for it
which i can get from:
Rich (BB code):
INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))

OnlySource is dynamically changing range depends whats data is imported
Rich (BB code):
=OFFSET('1st PASTE AIMS SOURCE'!$A$2,0,0,COUNTA('1st PASTE AIMS SOURCE'!$A:$A),COUNTA('1st PASTE AIMS SOURCE'!$2:$2)-1)
Lnk is dynamically changing range for headers depends whats data is imported
Rich (BB code):
=OFFSET('1st PASTE AIMS SOURCE'!$A$2,0,0,1,COUNTA('1st PASTE AIMS SOURCE'!$2:$2)-1)

Please help with some solution to be able have working hyperlink with valid friendly name which is taken from same cell.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Your 'Friendly' name has not been accidentally limited to the particular worksheet when you defined it on Name Manager? If so, you need to give it a 'worksheet'! path if accessing from another worksheet.
 
Upvote 0
Your 'Friendly' name has not been accidentally limited to the particular worksheet when you defined it on Name Manager? If so, you need to give it a 'worksheet'! path if accessing from another worksheet.
Hey SekeRob2,
In dynamic range i have path to worksheet
Rich (BB code):
'1st PASTE AIMS SOURCE'
Or should be directly written without dynamic range , but then i would have problem because each import is different and even column with same name can be in different columns that's why i use index/match functions to find proper column and then find proper row.

Cells from which i gain data looks like this:
Rich (BB code):
Example
and inside i have hyperlink to some page:
Rich (BB code):
http://example.com

When i want use index/match functions to get this cell in my target worksheet from source worksheet:
Rich (BB code):
=INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))
i will get result:
Rich (BB code):
Example
without hyperlink.
When i will do function with hyperlink function:
Rich (BB code):
=HYPERLINK(INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0)))
the my result will be:
Rich (BB code):
Example
but hyperlink leads to the page:
Rich (BB code):
Example
which doesn't exists.
So i use function GetUrl which i defined earlier and when i use this function with hyperlink:
Rich (BB code):
=HYPERLINK(GetUrl(INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))))
Then my result will be:
Rich (BB code):
http://example.com
and this will lead to my page i want, but i need here friendly name.
So i use function from to have working hyperlink and add only function for valid friendly name
Rich (BB code):
=HYPERLINK(GetUrl(INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0))),INDEX(OnlySource,ROW()-1,MATCH(L$2,Lnk,0)))
and result is:
Rich (BB code):
Example
But even i click on cell i have no message or anything that's should looks like this:

nofile.png


So i don't know what's going on.
 
Upvote 0
Hello,
I don't know how to attach file and don't have dropbox so i make image to show my problem more understandable.
I want make cell A2 to work (open page which is thereand I don't understand why.

example.png
 
Upvote 0
Hey,
sorry something cut my sentence and don't see edit button to fix last post.

I want make cell A2 to work to open gmail.com link but, it does nothing and I don't understand why.
"F2" cell works perfectly for friendly name and somehow when we add this function to "A2" as friendly name argument it's making all function in "A2" cell stop to work and nothing open or give any message.

If someone had similar problem please help i just stopped my project because of this annoying issue.

Thank you in advance.
 
Upvote 0

Forum statistics

Threads
1,214,922
Messages
6,122,281
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