Remove the Hyperlink

ChrisUK

Well-known Member
Joined
Sep 3, 2002
Messages
675
Hi.

I have a number of cells which all have hyperlinks in, I'd like to remove the hyperlink and just keep the label part - how can I do this please ?

TIA

Chris
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi Chris

Copy and paste the following into a standard module in your book, select the cells you want to remove hyperlinks from (doesn't matter if you include cells with no hyperlinks) and activate with Tools>Macro>Macros and run it.

Code:
Sub test()
For Each h In Selection.Hyperlinks
    h.Delete
Next h
End Sub

Best regards

Richard
 
Upvote 0
Hi Richard

I was not sure and so I've just checked, and the hyperlinks collection also has the delete method, which is great because the loop is not needed.

Code:
Sub test() 
    Selection.Hyperlinks.Delete
End Sub

Kind Regards
PGC
 
Upvote 0

Forum statistics

Threads
1,222,118
Messages
6,164,070
Members
451,870
Latest member
Nikhil excel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top