Extract url / adress from hyperlink cell in Excel

1. Go to Visual Basic for Applications module by clicking Alt+F11
2. Create new Module by Insert->Module
3. Create a simple function in the newly created module
Function GetCellUrl(LinkCell as Range)
   If LnkCell.Hyperlinks.Count = 0 Then
      GetCellUrl = ""
   Else 
      GetCellUrl = LnkCell.Hyperlinks(1).Address
       End If


     End Function

No comments:

Post a Comment