?
Solved

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

Posted on 2016-08-09
5
Medium Priority
?
200 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
5 Comments
 
LVL 33

Expert Comment

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

Accepted Solution

by:
Rgonzo1971 earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

809 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