Solved

Excel function to do exactly the opposite of =HYPERLINK()

Posted on 2016-08-09
5
104 Views
Last Modified: 2016-08-18
Hello,

Does Excel have a function which is exactly the opposite of =HYPERLINK()?

For example, using the =HYPERLINK() function, a long list of URLs in an Excel column can easily be converted to a corresponding list of hyperlinks in a different column.

I'm wondering if there is a function which, beginning with a long list of hyperlinks, will produce a corresponding list of URLs.

If not, what is the best workaround?

Thanks
0
Comment
Question by:WeThotUWasAToad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41749878
A sample workbook along with the desired output mocked up manually would be helpful.
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41749879
Hi,

If the friendly name is the same as the link, you could copy paste the value
if not pls try
Sub Macro()
For Each c In Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
    res = ""
    On Error Resume Next
    res = Evaluate(Split(Replace(Replace(c.Formula, "=HYPERLINK(", ""), ")", ""), ",")(0))
    On Error GoTo 0
    If res <> "" Then
        c.Offset(, 1) = res
    End If
Next
End Sub

Open in new window

Regards
0
 
LVL 18

Expert Comment

by:xtermie
ID: 41750115
Copy list of URLs and Paste as Values in new range is what you want I believe
(I think Rgonzo1971 suggests that too)
0
 
LVL 18

Expert Comment

by:xtermie
ID: 41750118
A macro can do that too, the following code will copy the URL from any hyperlink in the spreadsheet to the column NEXT to it :)
Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
    HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub

Open in new window

I've uploaded an example as well
Hyperlinks.xlsm
0
 

Author Closing Comment

by:WeThotUWasAToad
ID: 41761667
Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question