Xlookup to return cell text + hyperlink

Jobb1Excel

New Member
Joined
Oct 17, 2023
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hey, im looking for a formula that returns the hyperlink from the result of the xlookup from another sheet.

i got a "sheet1" and "sheet2": In the "sheet1" im using xlookup to find job descriptions (each material number has a job description file linked to the cell), but when i use the xlookup to get the job description for each material number it only returns the cell text and not the hyperlink from the cell. I have tried =hyperlink with no luck...

1702548949831.png

Cell A1-A4 is the cells with hyperlink im using xlookup to find. But the result i get is example: 1 and no link.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I am assuming the links in column A weren't created the HYPERLINK() function, correct? If so, you either have to use Office Scripts or VBA to accomplish this.

Here is a VBA function that I found here:

VBA Code:
Function GetURL(cell As Range)
    GetURL = cell.Hyperlinks(1).Address
End Function
 
Upvote 0
I am assuming the links in column A weren't created the HYPERLINK() function, correct? If so, you either have to use Office Scripts or VBA to accomplish this.

Here is a VBA function that I found here:

VBA Code:
Function GetURL(cell As Range)
    GetURL = cell.Hyperlinks(1).Address
End Function
I have already tried to use the VBA function with no luck. I dont think the links was created with the HYPERLINK() function.
 
Upvote 0
May I ask a little before making the right formula,

1. What kind of "HYPERLINK" formula do you have (See Image)

2. Your excel uses commas or semicolons

1702625337216.png
 
Upvote 0
the function I sent you should work. I said I assumed you AREN'T using the HYPERLINK function. The VBA function will work when it is like the screenshot you just posted.
This function, will only return the Link text, but not a functional Link. You can't get the Link to work, as Excel do not insert the Link itself.
If you Right click on the text, pulled out (looks like a Link), and choose Link, you will see in the opened Box, that the Link are missing.
 
Upvote 0
Using the function that @ExcelToDAX provided see if this gives you any ideas ?
(so you will need to put the code in Post 2 in a standard module and save the workbook as xlsm or xlsb)
PS: I did have to manually format the range as Hyperlink

20231215 VBA Hyperlink Jobb1Excel not working.xlsm
ABCDEF
1Lookup ArrayXlookup
2
3Apple LinkAppleLookup -->AppleApple Link
4Orange LinkOrange
5Pear LinkPear
6Kiwi LinkKiwi
7
Lookup
Cell Formulas
RangeFormula
F3F3=LET(rCell,XLOOKUP(E3,$B$2:$B$10,$A$2:$A$10,""),IF(rCell<>"",HYPERLINK(GetURL(rCell),rCell),""))
 
Upvote 0
Using the function that @ExcelToDAX provided see if this gives you any ideas ?
(so you will need to put the code in Post 2 in a standard module and save the workbook as xlsm or xlsb)
PS: I did have to manually format the range as Hyperlink

20231215 VBA Hyperlink Jobb1Excel not working.xlsm
ABCDEF
1Lookup ArrayXlookup
2
3Apple LinkAppleLookup -->AppleApple Link
4Orange LinkOrange
5Pear LinkPear
6Kiwi LinkKiwi
7
Lookup
Cell Formulas
RangeFormula
F3F3=LET(rCell,XLOOKUP(E3,$B$2:$B$10,$A$2:$A$10,""),IF(rCell<>"",HYPERLINK(GetURL(rCell),rCell),""))
This gives me error:
1702889368923.png
1702889403444.png
The Xlookup returns the 5, but get get link part of the formula does not work or i might be doing something wrong.
 
Upvote 0
Did you put the code for the function ExcelToDAX gave you in post #2 into a standard module and save your workbook as xlsm ?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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