Find and Replace Hyperlinks (url links) in Excel

Excel has some strange behaviors, one of them is that the “find & replace” function doesn’t work with hyperlinked content.   In order to overcome this you need to use a simple macro. Here are the steps to take:

  1. While on the spreadsheet you wish to edit press ALT + F11 – this will open the Visual Basic Application Window
  2. Click Insert > Module, and paste the following macro in the Module window
  3. Run this Macro by pressing F5 – fill the old and new text in the popup boxes and it will make the replace

4 comments

  1. Compile Error:
    Expected: end of statement

    If I am supposed to just use the content in the above example, what am I missing?

    1. Hi David,

      What version of excel are you using?
      Are you sure you copied the entire code above with no missing characters?

  2. Damn this was so easy! Took me more time to find your solution than to run it and fix all my spreadsheets! You may want to make a note that not only will it replace whole URL’s but will also change parts of the URL. I changed just the name of a subdirectory, and didn’t have to enter the entire URL, just the text I wanted changed.
    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *