Excel.Tips.Net ExcelTips (Menu Interface)

Getting Rid of Many Hyperlinks

Summary: Got a bunch of hyperlinks you need to get rid of? Here's a handy (and simple) macro that can do the task for you. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

Do you create worksheets by pasting information that was copied from the Internet? This is not unusual for some people, as there is quite a bit of public-domain information that can be copied from the Internet. When you paste your information into a worksheet, you may notice that there are quite a few hyperlinks. What if you want to get rid of those hyperlinks? Similarly, you might inherit a worksheet from someone, and it contains a lot of hyperlinks you want deleted.

The easiest approach is to run a macro that deletes all the hyperlinks. The following macro quickly removes all hyperlinks in a document, without affecting anything else in the worksheet:

Sub KillLinks()
    Do Until ActiveSheet.Hyperlinks.Count = 0
        ActiveSheet.Hyperlinks(1).Delete
    Loop
End Sub

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3249) applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007

Related Tips:

Your Data, Your Way! Want the greatest control possible over how your data appears on the page? Excel's custom formats can provide that control, and ExcelTips: Custom Formats can unlock the secrets to creating your own custom formats. Check out ExcelTips: Custom Formats today!