Link to home
Start Free TrialLog in
Avatar of samirst
samirst

asked on

Macro for removing hyperlinks from spreadsheet

Hi Experts,
I have an Excel spreadsheet that has hyperlinks randomly scattered in different cells within the spreadsheet, is there a way of having a macro that can remove all hyperlinks in the spreadsheet. Thanks
Sam
ASKER CERTIFIED SOLUTION
Avatar of chipconsult
chipconsult
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of zorvek (Kevin Jones)
zorvek (Kevin Jones)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samirst
samirst

ASKER

Guys, both solutions worked perfectly and have the exact timestamp when posted. So the best option is to split the points equally. Many thanks for your help.
Sam
Sub RemoveHyperlinks()
ActiveSheet.Hyperlinks.Delete
End Sub

will also do it.
Regards,
Rory
A little add-on:
If you want to delete the text as well it is done with:

Sub RemoveHyperlinks()

For Each hl In ActiveSheet.Hyperlinks

    Range(hl.Range.Address).ClearContents

Next hl

End Sub

Claus Henriksen