Solved

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

Posted on 2014-04-27
3
331 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
Comment Utility
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 26

Accepted Solution

by:
MacroShadow earned 500 total points
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now