Extract URLs from Hypertext in Excel
In this post, I will explain the process to extract hyperlinks from a text/hyperlinked text using VBA/macros.
Video: Click here to Watch Video.
Follow the below steps:
- Open the Excel file and paste the hyperlinked text in the column first.
- Open view code window by holding alt+F11.
- Paste the below code.
- Run the macro by using the "execute button" or by pressing F5.
- In column B you will get the desired result.
Code:
Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub
Thank you for reading the post!
Comments
Post a Comment