|
Remove (Delete) Hyperlinks from Worksheets
This macro will remove all hyperlinks from the active worksheet. It will delete the hyperlinks but it will not delete the text of the link. This means that you will still have all of the text left over but without the links to the websites. This is a great macro to use in excel if you import a lot of data from the web or if you import lists of emails or web addresses but do not want them to actually retain their hyperlinks.
This macro will work on the entire active worksheet, you do not need to select any cells.
Where to install the macro: Module
Remove (Delete) Hyperlinks from Worksheets
Sub Remove_All_Hyperlinks()
'Removes hyperlinks from the active worksheet
'Does not delete the hyperlink text, only the link to the site
Do Until ActiveSheet.Hyperlinks.Count = 0
ActiveSheet.Hyperlinks(1).Delete
Loop
End Sub
How to Install the Macro
- Select and copy the text from within the grey box above.
- Open the Microsoft Excel file in which you would like the Macro to function.
- Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.
Or For other ways to get there, Click Here.
For Excel Versions Prior to Excel 2007 Go to Tools > Macros > Visual Basic Editor
For Excel 2007 Go to Office Button > Excel Options > Popular > Click Show Developer tab in the Ribbon. Then go to the Developer tab on the ribbon menu and on the far left Click Visual Basic
- On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.
- If the Macro goes in a Module, Click Here, otherwise continue to Step 8.
- Go to the menu at the top of the window and click Insert > Module
- Another window should have opened within the Visual Basic Editor's window. Within this new window, paste the macro code. Make sure to paste the code underneath the last line of anything else that is in the window.
- Go to Step 8.
- If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Then, at the bottom of the list that appears, double-click the ThisWorkbook text.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Go to Step 8.
- If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.
- Directly underneath your excel file called VBAProject(your file's name here), click the Microsoft Excel Objects folder icon to open that drop-down list.
- Within the list that appears you will see every worksheet that is in that excel file. They will be listed as such: Sheet1(NAME OF SHEET HERE) and under that will be Sheet2(NAME OF SHEET HERE). Select the sheet in which you want the macro to run and double-click that sheet.
- A new window inside the Visual Basic Editor's window will appear. In this new window, paste the code for the macro. Make sure to paste this code underneath the last line of any other code which is already in the window.
- Repeat steps b and c for every sheet you want the macro to work in. Putting the macro in one sheet will not enable it for any other sheets in the workbook.
- Go to Step 8.
- Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.
- You are now ready to run the macro.
Similar Helpful Excel Resources
An outside application exports data to an Excel spreadsheet, but all the
numbers (part numbers in this case) are created as hyperlinks. My
spreadsheet can contain hundreds of numbers. Is there any way I can remove
the hyperlinks en masse rather than one by one? I can't change the program
that creates the spreadsheet.
Thanks,
Dave
Excel XP, Win XP
I have a list of hundreds of hyperlinked cells scattered throughout more
hundreds of non-hyperlinked cells. I want to remove the hyperlinks. What
is the code query for a hyperlinked cell?
Something like:
If ActiveCell....hyperlink...=True Then
Thanks for your time. Otto
Okay, I have an easy one.
I have 35 e mail addresses. How can remove the hyperlink property but leave the address? I can remove one hyperlink at a time but that will take a long time.
Is there a difference on this between 2002 and 2000?
Thanks
Berg
I have a list of thousands of names with emails. The email shown in the cell is accurate but when I click on it I get a hyperlink to a differnet email. How do I do a mass change to remove all the hyperlinks in that column?
Hi,
I have an Excel column with e-mails but they are hyperlinked.
So, I cannot edit them because it opens my e-mail server.
How can I remove the hyperlinks?
SantistaS
Hi All
I've copied 2 x columns x 760 rows of data from a web site and pasted to a new workbook. The data in column 1 are all sequential numbers for fault codes and each has a hyperlink. How can I remove all the hyperlinks, as I only require the number. I've tried pasting as text, but then I lose the columns.
Thanks Simon
Hi Everyone,
Is it possible to create a macro, which removes several /all/ hyperlinks, or according to prevously selected cells?
Thank you in advance!
I have an exported file with more than 100 hyperlinks. How can i remove the hyperlink (en mass) without disrupting the format of the spreadsheet?
hey.
my team is using a shared spreadsheet with loads an loads of hyperlinks to a different spreadsheet that i'm somehow unable to remove.
when you right-click, the "delete hyperlink" & "edit hyperlink" option is greyed out, only "open hyperlink" is available. when you click "open" you get the error message: Unable to open, as the file it links to doesn't exist anymore.
the spreadsheet is not protected as far as i can see either...
i tried to delete & paste special (value only). but it doesn't affect the hyperlink at all
any ideas? thanks!
Hello,
how can i remove all Hyperlinks in every single cells at once in a column?
Greets
Thanks in advance
|
|