Solved

Extract URLs from a series of icons with embedded links which have been pasted into Excel

Posted on 2014-04-27
3
335 Views
Last Modified: 2014-05-15
Hello,

Is there a non-manual way to extract URLs from a series of icons with embedded links which have been pasted into Excel?

For example, suppose you are on a website page which displays a list of articles or maybe chapters of a book. And suppose that for each chapter, there is a link which you can click if you want to read that chapter (in HTML) and also an icon link (like an image of a speaker) which you can click if you want to listen to an audio file of the chapter.

If I copy that page and then paste it into an Excel spreadsheet with the origin formatting, then the result will contain both the HTML links and the icons with their links. There's some re-formatting required but before long, I can create a nifty list in which each of the HTML links behaves in the same way any other cell defined as a link does.

However, I am trying to figure out how to do the same thing with the audio file links. I've got the string of icons in front of me and each still has its link but they of course behave like images pulled in from PowerPoint. Any single icon's link can be obtained by right-clicking the icon then clicking "edit hyperlink" and so on but I am hoping to find a way to capture all of the audio link destination URLs en masse.

Suggestions?

Thanks
0
Comment
Question by:WeThotUWasAToad
3 Comments
 
LVL 18

Expert Comment

by:Rartemass
ID: 40026618
How I generally start with something like this is to begin recording a macro and then perform the steps I want to achieve.
So if you can select the icon and right click to edit hyperlink and copy/paste it elsewhere, the macro should create the code. Then you can modify it to select all images and iterate through them with a loop.
It would be easier to give specific advise if we could see sample data you are working with.
0
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 40026634
Try this:
Sub ExtractHyperlinks()

    Dim sh As Shape

    On Error Resume Next ' if shape is not directly over a cell an error will be thrown, skip that shape
    
    For Each sh In ActiveSheet.Shapes
        sh.TopLeftCell.Offset(, 1) = sh.Hyperlink.Address
    Next

End Sub

Open in new window

0
 

Author Closing Comment

by:WeThotUWasAToad
ID: 40068948
Thanks
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
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;…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

773 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