Extract URL from text

Tested in Excel 365 (16.8730.2046) 64-bit

 
 
  1. Sub ExtractURLFromText()
  2.     Dim i, LastRow
  3.    
  4.     LastRow = Range("A" & rows.Count).End(xlUp).Row
  5.    
  6.     On Error Resume Next ' in case is just plain text
  7.    For i = 1 To LastRow
  8.         Cells(i, 1).Select
  9.         Cells(i, 2).Value = ActiveCell.Hyperlinks(1).Address
  10.     Next i
  11. End Sub

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.