Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Getting Rid of All Hyperlinks.

Getting Rid of All Hyperlinks

Written by Allen Wyatt (last updated June 19, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

If you inherit worksheets from other people, you may find that some worksheets contain many, many hyperlinks. These hyperlinks are often automatically created by Excel as you import or enter information in the worksheet. (I see them appear all the time when I paste information into a worksheet that was copied from a web page somewhere.)

If you want to delete these hyperlinks, you can do so by right-clicking on them and choosing Hyperlink | Remove Hyperlink from the Context menu. Doing this with dozens or hundreds of hyperlinks can quickly consume a huge amount of time. Accomplishing such a task quicker calls for the use of a macro.

The following macro quickly removes all hyperlinks in a worksheet, without affecting anything else it may contain:

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

The macro works by stepping through the Hyperlinks collection and deleting anything that is located there. (The Hyperlinks collection allows access to all of the hyperlinks in a document. Convenient, huh?)

You can, if desired, make the macro even shorter, down to a single line:

Sub KillLinks2()
    ActiveSheet.Hyperlinks.Delete
End Sub

Select the worksheet you want to affect, run one of these macros, and you just saved yourself tons of time!

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10782) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Getting Rid of All Hyperlinks.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Technique for Adding a Text Box to an Envelope

Text boxes can be a great design feature to use in laying out a document. You may want to add one to an envelope, ...

Discover More

Non-breaking Em Dashes

Need an em dash to be "sticky" on both ends of the dash? Word doesn't provide such formatting, but there are a few ...

Discover More

Understanding Frames and Text Boxes

What is the difference between frames and text boxes? Why use one over the other? Find out here.

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Dealing with Hyperlinks that Won't Work

You can add hyperlinks to a worksheet and Excel helpfully makes them active so that when you click them the target of the ...

Discover More

Hyperlinks in Shared Workbooks

Inserting a hyperlink into a workbook that is shared with others is not possible in Excel. Here's what you can do about it.

Discover More

Opening an HTML Page in a Macro

Excel allows you to open HTML pages within the program, which is great for some purposes. What if you want to open a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 - 0?

2021-06-19 10:21:02

J. Woolley

You can also click Ctrl+A to Select All, then right-click and pick Remove Hyperlinks. But neither this nor the Tip's macros will affect formula cells that contain the built-in HYPERLINK function or My Excel Toolbox's SuperLink function (after recalc). See https://sites.google.com/view/MyExcelToolbox/


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.