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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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,214,560
Messages
6,120,222
Members
448,951
Latest member
jennlynn

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