How to extract URLs from hyperlinked text

ameenakbar

New Member
Joined
Mar 15, 2014
Messages
30
I have data like this.
Google
MSN

<tbody>
</tbody>

in above data google and msn are hyperlink with URLs.
Now I want extract URLs in next cells, like below.
Googlehttps://google.com (with formula)
MSNhttps://msn.com

<tbody>
</tbody>

Is there any formula / macro or some other way.
 
Last edited:

Excel Facts

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

Try this

Sub ExtractHyper()
Dim HP As Hyperlink
For Each HP In ActiveSheet.Hyperlinks
HP.Range.Offset(0, 1).Value = HP.Address
Next
End Sub
 
Upvote 0
Here is another macro that you can try which targets a specified range (as written, cell A1 on downward)...
Code:
[table="width: 500"]
[tr]
	[td]Sub ExtractHyperlinkAddresses()
  Dim Cell As Range
  For Each Cell In Range("[B][COLOR="#FF0000"]A1[/COLOR][/B]", Cells(Rows.Count, "[B][COLOR="#FF0000"]A[/COLOR][/B]").End(xlUp))
    Cell.Offset(, 1).Value = Cell.Hyperlinks.Item(1).Address
  Next
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,179
Messages
6,129,336
Members
449,503
Latest member
glennfandango

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