Extracting Url from a hyperlink
Dim hlnk as Hyperlink, rng as Range
for each hlnk in ActiveSheet.Hyperlinks
set rng = hlnk.parent.offset(0,-1)
rng.Value = hlnk.Address
if len(trim(hlnk.SubAddress)) < 0 then
rng.Value = Trim(rng.value & " " & hlnk.SubAddress)
End if
Next
--
Regards,
Tom Ogilvy
"Henry" wrote in message
...
ok, but how do you insert the url nexto the cell where the url was found ?
henry
"Tom Ogilvy" wrote:
i = 1
for each hlnk in ActiveSheet.Hyperlinks
Cells(i,1).Value = hlnk.Address
Cells(i,2).Value = hlnk.SubAddress
i = i + 1
Next
--
Regards,
Tom Ogilvy
"Carlton Noles" wrote in message
...
I have a large list of hyperlinks I have imported to
Excel. I need to get the urls these links point to. Is
there a way to do this through code or an Excel function?
|