Remove hyperlinks

G

Graham H

I have downloaded a lot of text from a site and most of it is in hyperlinks, but I just
want the text. Is there a quick way to remove all the hyperlinks in a worksheet or
workbook. I appreciate I could loop round all the cells but there is a lot of material and
I just wondered if there was something simpler. I would value any help.

Regards
Graham
 
N

NateBuckley

Sub RemoveHyperLinks()
Dim hlinks As Hyperlinks
Dim hlink As Hyperlink
Set hlinks = Sheet1.Hyperlinks

For Each hlink In hlinks
hlink.Delete
Next hlink

End Sub

There you go :D grab the hyperlinks collection from Sheet1 (change if on
another sheet) and then go through each hyperlink in the collection, deleting
as you go.

Hope this helps! :)
 
N

NateBuckley

Oops, Norman's way is much better - Only one line and poof! They're all gone.
 
G

Graham H

Thanks for that Norman, I think Nates description of "one line and poof!" sums it up.
Many thanks to both of you.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top