In this tutorial, I will explain how to edit a hyperlink in excel. Usually, we use hyperlinks often to serve different purposes such as: to go to a specific website, a location in the existing workbook, or opening a new excel file. In addition, you can open a different document or create email messages. However, you might need to edit these hyperlinks at times or fix broken ones. So, let’s see how we can edit hyperlinks.
In my Excel file, I have created several hyperlinks as below. Now, I will show you how to edit some of them.
The easiest option to edit hyperlinks is to right-click on the active cell and thus edit later. For instance, Cell B5 is hyperlinked to www.exceldemy.com and I want to edit the link to www.google.com.
- Right-click on Cell B5 and select the Edit Hyperlink.
- As a result, the Edit Hyperlink dialog box will show up.
- Next, I have replaced ‘exceldemy’ with ‘google’ in the fields: Text to display and Address. You can edit as you require and then click OK.
- As a consequence, the hyperlink in Cell B5 will direct you to google.com. You can change other hyperlinks by following the above method; depending on the type of the links.
Read More: How to Create a Hyperlink in Excel
We can modify hyperlinks from the Insert tab in excel. For example, I will change the hyperlink of Cell B5 to www.microsoft.com.
- Click on the hyperlink containing cell (Cell B5).
- Go to Insert > Link (Links group).
- Now, go to Link > Insert Link.
- Then, the Edit Hyperlink dialog box will show up. Put ‘microsoft’ here like we showed in the procedure of Method 1 and click OK (see screenshot).
- Finally, the modified hyperlink will direct us to the updated website.
Read More: Excel Hyperlink with Shortcut Key
Sometimes, we have multiple cells hyperlinked to the same address. In that case, if we can change the address of those multiple cells at once, that will save a lot of time. For instance, I have several cells that are hyperlinked to www.exceldemy.com. Now I will convert this path to www.google.com using VBA.
- First, go to the sheet where the cells are hyperlinked and right-click on the sheet name, and select the View Code option.
- Next, Microsoft Visual Basic for Applications window will show up. Write the below code in the Module.
Dim Sheet As Worksheet
Dim xhyperlink As Hyperlink
Dim xPast As String, xChanged As String
xTitleId = "EditHyperlink"
Set Sheet = Application.ActiveSheet
xPast = Application.InputBox("Former text:", xTitleId, "", Type:=2)
xChanged = Application.InputBox("Changed text:", xTitleId, "", Type:=2)
Application.ScreenUpdating = False
For Each xhyperlink In Sheet.Hyperlinks
xhyperlink.Address = Replace(xhyperlink.Address, xPast, xChanged)
Application.ScreenUpdating = True
- Run the code using the F5 Upon running the code the below window (EditHyperlink) will show up. Then write ‘exceldemy’ in the field ‘Former text’ and click OK. I have put ‘exceldemy’ as our existing hyperlinks contain this word in the path.
- After you click OK again, the EditHyperlink window will show up. Now enter the new website address (google) in the ‘Changed text’ field and click OK.
- Consequently, all hyperlinked addresses are changed to www.google.com.
Sometimes, hyperlinks do not work as expected. The reason might be that you have entered the wrong web addresses or wrong file path and so on. Let’s see how to fix these broken links. Such as if your web address is not correct, you will see the below warning (see the screenshot).
To fix the above symptom, we will follow the below steps.
- Go to the hyperlink containing cell (Cell B5) and right-click on it to bring the Edit Hyperlink dialog box.
- Then fix the URL in the Address field. For example, I have replaced ‘exceldem’ with ‘exceldemy’. Next, click OK.
- As a result, the broken link will be fixed and the link will direct us to the website.
- In case your hyperlink cannot open a specific file, you have to update the file path as below and click OK (see the screenshot).
Read More: How to Fix Broken Hyperlinks in Excel
Sometimes when we copy addresses to excel cells, those URLs might not look like clickable hyperlinks. Those links will merely look like text strings. For example, I have some web addresses copied to my Excel file.
To convert above URLs to hyperlinks, follow the below steps.
- Just double-click on the cell containing the non-clickable URL (Cell B5) and hit Enter.
- As a result, excel will automatically convert the URL to a hyperlink.
Read More: How to Convert Text to Hyperlink in Excel
We know that by default the color of hyperlinks is blue. If you want to change the color of the hyperlink of a selected cell, follow the below steps.
- Select the Cell B5.
- Go to Home > Cell Styles (Styles group).
- Next, from Cell Styles, right-click on the Following Hyperlink and click on Modify.
- Consequently, the Style dialog box will pop up. Click on the Format.
- Clicking on the Format will direct you to the Format Cells window. You can change font style, size, color, etc, from there. After you are done with the editing, click OK. I have changed the Font Color only.
- Upon clicking OK, you will see the changes in the Style dialog, again click OK.
- Now, double-click on Cell B5, and the hyperlink will be modified to changed color.
➤ You can change the color of the hyperlinks that are not clicked yet by following the path:
Home > Cells Styles > Hyperlink.
➤ You cannot change the color of only one hyperlink following the above method, the color of all the hyperlinks in the workbook will change.
Download Practice Workbook
You can download the practice workbook that we have used to prepare this article.
In the above article, I have tried to discuss several methods to edit the hyperlink in Excel elaborately. Hopefully, these methods and explanations will be enough to solve your problems. Please let me know if you have any queries.
- How to Hyperlink to Cell in Same Sheet in Excel
- Excel Hyperlink to Cell in Another Sheet with VLOOKUP
- How to Add Hyperlink to Another Sheet in Excel
- Excel Hyperlink to Another Sheet Based on Cell Value
- How to Create a Drop Down List Hyperlink to Another Sheet in Excel
- How to Create Dynamic Hyperlink in Excel
- How to Copy Hyperlink in Excel
- How to Create Button to Link to Another Sheet in Excel