Watch Video – How to Remove Hyperlinks in Excel
I often find it quite frustrating when Excel automatically creates a hyperlink as soon as I insert an email id or a URL in a cell and hit enter.
Now, when I try to select a cell (or double-click on it to get into the edit mode), it automatically opens the link in a new browser window.
In such cases, there is a need to remove these hyperlinks from the worksheet.
In this tutorial, I will show you 2 methods to remove existing hyperlinks in a worksheet, and an awesome technique to prevent Excel from creating hyperlinks on its own.
Suppose you have a dataset where Excel has automatically created hyperlinks in URLs or email ids.
Here are the steps to remove hyperlinks from the selected cells:
- Select the data from which you want to remove hyperlinks.
- Right-click on any of the selected cell.
- Click on the ‘Remove Hyperlink’ option.
The above steps would instantly remove hyperlinks from the selected cells.
In case you want to remove hyperlinks from the entire worksheet, select all the cells and then follow the above steps.
While the above method of removing hyperlinks with 2 clicks is quite easy, you can also use VBA to bring this down to a single click.
But before it becomes a one-click functionality, there is some pre-work that you need to do (as described below).
The below VBA macro code instantly removes all the hyperlinks from the active worksheet.
Sub RemoveAllHyperlinks() 'Code by Sumit Bansal @ trumpexcel.com ActiveSheet.Hyperlinks.Delete End Sub
Here are the steps to put the VBA code in the backend and enable one-click hyperlink removal:
- Copy the above VBA code
- Go to the Developer tab.
- Click on Visual Basic.
- In the VB Editor, right-click on any of the workbook objects.
- Go to Insert and click on Module.
- In the module, paste the above VBA code.
- Close the VB Editor.
The above steps ensure that the VBA code is in the backend and would remove hyperlinks from the entire sheet when it’s run.
Now to further simplify this process, you can add the macro to the Quick Access Toolbar (QAT). This will allow you to remove hyperlinks from the entire worksheet with a single click.
Here are the steps to add the VBA macro to the QAT:
- Click on the Customize Quick Access Toolbar icon.
- Select ‘More Commands’.
- In the Excel Options dialogue box, in the ‘Choose command from’ dialog box, select ‘Macros’.
- Click on the Macro that you want to add to the QAT.
- Click on the Add button.
- Click OK.
The above steps would add the macro to the QAT.
Now to remove all the hyperlinks from the worksheet, all you need to do is click on the macro in the QAT.
If you don’t want to remove all the hyperlinks in a worksheet, but only the ones in the selected range, use the below VBA code:
Sub RemoveHyperlinksfromSelection() 'Code by Sumit Bansal @ trumpexcel.com Selection.Hyperlinks.Delete End Sub
If you often have the need to remove hyperlinks from a worksheet (or a selected range), it’s a good idea to save this macro in your personal macro workbook.
Here is a detailed guide on how to save a macro in the personal macro workbook. Once saved in the personal macro workbook, it will be available in all the workbooks on your system.
So far we have been treating the symptoms.
Now let’s see how to target the root cause of the issue – URLs/Emails automatically getting converted into hyperlinks.
The reason this happens as there is a setting in Excel that automatically converts ‘Internet and network paths’ into hyperlinks.
Here are the steps to disable this setting in Excel:
- Go to File.
- Click on Options.
- In the Excel Options dialog box, click on ‘Proofing’ in the left pane.
- Click on the AutoCorrect Options button.
- In the AutoCorrect dialog box, select the ‘AutoFormat As You Type’ tab.
- Uncheck the option – ‘Internet and network paths with hyperlinks’
- Click OK.
- Close the Excel Options dialog box.
If you’ve completed the following steps, Excel would not automatically turn URLs, email address, and network paths into hyperlinks.
Note that this change is applied to the entire Excel application, and would be applied to all the workbooks that you work with.
You May Also Like the Following Excel Tutorials: