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:

  1. Open the Excel file and paste the hyperlinked text in the column first.
  2. Open view code window by holding alt+F11.
  3. Paste the below code.
  4. Run the macro by using the "execute button" or by pressing F5.
  5. 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

Popular posts from this blog

Effortlessly Import JSON Data into SharePoint with Power Automate Flow: A Step-by-Step Guide

Generic Design Powerapps, Sharepoint and flow