T
Thomas Guignard
Hi there
I need to extract URLs from cells that are in the form
=LIEN_HYPERTEXTE("http://www.example.com";"URL")
(french version of Excel, I guess you can work out the english equivalent)
These cell appear as hyperlinks, but I need to extract the actual URL
and store it in another column.
I have found this URL-extract function somewhere on the web (can't find
the reference right now):
Public Function ShowAddress(rng As Range) As String
If rng.Cells.Count > 1 Then
ShowAddress = CVErr(xlErrValue)
Else
ShowAddress = rng.Hyperlinks.Item(1).Address
End If
End Function
But if I try to use this function in my spreadsheet, like
=ShowAddress(E2) for example, I get a #VALUE! error. And indeed, in
debug mode I see that the value of the variable rng in the above
function is set to "URL" so the hyperlink text, not the whole cell
content. Which explains why the function can't extract hyperlink
information.
How can I solve my problem? How can I make sure I get the actual cell
content and not only the result of the LIEN_HYPERTEXTE function?
Thanks for your help
I need to extract URLs from cells that are in the form
=LIEN_HYPERTEXTE("http://www.example.com";"URL")
(french version of Excel, I guess you can work out the english equivalent)
These cell appear as hyperlinks, but I need to extract the actual URL
and store it in another column.
I have found this URL-extract function somewhere on the web (can't find
the reference right now):
Public Function ShowAddress(rng As Range) As String
If rng.Cells.Count > 1 Then
ShowAddress = CVErr(xlErrValue)
Else
ShowAddress = rng.Hyperlinks.Item(1).Address
End If
End Function
But if I try to use this function in my spreadsheet, like
=ShowAddress(E2) for example, I get a #VALUE! error. And indeed, in
debug mode I see that the value of the variable rng in the above
function is set to "URL" so the hyperlink text, not the whole cell
content. Which explains why the function can't extract hyperlink
information.
How can I solve my problem? How can I make sure I get the actual cell
content and not only the result of the LIEN_HYPERTEXTE function?
Thanks for your help