View Single Post
  #1   Report Post  
Ryan Sapien
 
Posts: n/a
Default Extract hyperlink string from excel cell

Forgive my ignorance but I haven't done a lot of work with Excel VBA.
So do I just have to paste the function into the VBA window and then
add =HyperLinkText(CellName) on my worksheet cell?

Thanks

Ryan


Bill Manville wrote:
Markus Riester wrote:
Is there a function that is available (I didn't find one
in the standard functions Excel offers), or does anyone
have a macro?

Something like this?

Function HyperLinkText(oRange As Range) As String
Dim ST1 As String, ST2 As String
If oRange.Hyperlinks.Count = 0 Then Exit Function
ST1 = oRange.Hyperlinks(1).Address
ST2 = oRange.Hyperlinks(1).SubAddress
If ST2 < "" Then ST1 = "[" & ST1 & "]" & ST2
HyperLinkText = ST1
End Function


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup