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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
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
 

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,887
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
 

Forum statistics

Threads
1,171,719
Messages
5,877,116
Members
433,232
Latest member
mobekie

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
Top