Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to change multiple hyperlink paths at once in Excel?

For some purpose, you may create multiple hyperlinks for your values in the worksheet, and all of the hyperlinks are linked to the same file path or address, but now, you need to replace this hyperlink path with another address at a time. To change the path of the hyperlinks individually may waste a lot of time, is there a quick way to solve this problem?

Change multiple hyperlink paths at once with VBA code

Extract real addresses from hyperlinks with Kutools for Excel

Remove all hyperlinks from selection / worksheet / workbook with Kutools for Excel


Extract / display real addresses from hyperlinks:

With Kutools for Excel’s Convert Hyperlinks, you can quickly extract real URL addresses from hyperlinked cells at once.

doc extract address from hyperlinks


arrow blue right bubble Change multiple hyperlink paths at once with VBA code


Supposing you have a list of data with the same hyperlinks as following screenshot shown, and with a VBA code, you can quickly replace the old file path or address with a new one.

doc-change-hyperlinks1

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications Window.

2. Click Insert > Module, and paste the following macro in the Module window.

VBA code: change multiple hyperlink paths at once

Sub ReplaceHyperlinks()
'Updateby20140220
Dim Ws As Worksheet
Dim xHyperlink As Hyperlink
Dim xOld As String, xNew As String
xTitleId = "KutoolsforExcel"
Set Ws = Application.ActiveSheet
xOld = Application.InputBox("Old text:", xTitleId, "", Type:=2)
xNew = Application.InputBox("New text:", xTitleId, "", Type:=2)
Application.ScreenUpdating = False
For Each xHyperlink In Ws.Hyperlinks
    xHyperlink.Address = Replace(xHyperlink.Address, xOld, xNew)
Next
Application.ScreenUpdating = True
End Sub

3. Then press F5 key to run this code, and a prompt box to let you input your old hyperlink address into the Old text box. See screenshot:

doc-change-hyperlinks2

4. Click OK, and another prompt box is popped out to remind you entering the new hyperlink address that you want to use.

doc-change-hyperlinks3

5. And then click OK, all the same old hyperlink addresses have been replaced by the new one at once. See screenshots:

doc-change-hyperlinks4 -2 doc-change-hyperlinks5

arrow blue right bubble Extract real addresses from hyperlinks with Kutools for Excel

If you want to extract the actual addresses from the hyperlinks in Excel, how could you do? With Convert Hyperlinks of Kutools for Excel, you can quickly deal with this task.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

If you have Kutools for Excel, please do as follows:( Free Download Kutools for Excel Now

1. Click Kutools > Link > Convert Hyperlinks, see screenshot:

doc-change-hyperlinks5

2. In the Convert Hyperlinks dialog box, select Hyperlinks addresses replace cell contents option under the Convert type section, and then click the first doc change hyperlinks8 button to select the range of hyperlinks that you want to extract the real addresses, click the second doc change hyperlinks8button to choose a cell where you want to put the result, see screenshot:

doc-change-hyperlinks5

3. Then click OK button, and all the real addresses have been extracted from the selected hyperlinks, see screenshot:

doc-change-hyperlinks5

Click to know more about this Convert Hyperlinks feature.

Free Download Kutools for Excel Now


arrow blue right bubble Remove all hyperlinks from selection / worksheet / workbook with Kutools for Excel

Lots of hyperlinks needed to be removed from your worksheet or workbook, Kutools for Excel’s Delete Hyperlinks function can help you remove the hyperlinks in a selected range, in one or multiple worksheet, in a workbook.

After installing Kutools for Excel, please do as this:( Free Download Kutools for Excel Now

Click Kutools > Links > Delete Hyperlinks, then choose the scope which you want to remove the hyperlinks, see screenshot:

doc-change-hyperlinks5

Click to know more about this Delete Hyperlinks feature.

Free Download Kutools for Excel Now


Related articles:


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Lona · 1 years ago
    I need to only get part of my text in the hyperlinks removed.
  • To post as a guest, your comment is unpublished.
    Taylor · 1 years ago
    For some reason, these macros have quit working recently. I have used them multiple times to fix issues on many spreadsheets but now it doesn't do anything. No errors just no corrections
  • To post as a guest, your comment is unpublished.
    Fabio · 1 years ago
    Wow, thanks. Its amazing that Excel doesn't have a solution for cases like this.
  • To post as a guest, your comment is unpublished.
    Vern · 1 years ago
    Sorry, nevermind about my question, I stumbled on my answer. I exited out of the macro editor, placed my cursor in cell A1 of the worksheet I wanted to edit and ran the macro and Boom all the links were changed! Thanks so much!
  • To post as a guest, your comment is unpublished.
    Vern Poplaski · 1 years ago
    I loaded the hyperlink change macro and ran it. It worked but only on the active cell. How do you get it to go through the entire worksheet?