Solved

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

Posted on 2016-08-09
5
79 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 29

Expert Comment

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

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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

825 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