[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2016-08-09
5
Medium Priority
?
169 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 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 53

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

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

656 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