Hi,
I have an Excel and on some of the 'D' column elements there is a Hyperlink. I need that links so I wrote the following code:
record = "D" & i ' (i is incresing in every step)
Range(record).Select
If Len(Selection.Hyperlinks(1).Address) > 0 Then (*)
link = Selection.Hyperlinks(1).Address
Else
link = ""
End If
But when there is no hyperlink it gives me the error: "subscript out of range" on the (*) line.
I tried using: Selection.Hyperlinks(1).Address <>""
Any idea?
Or maybe another code which gives me these hyperlinks?
Thank you,
Kenguru
I have an Excel and on some of the 'D' column elements there is a Hyperlink. I need that links so I wrote the following code:
record = "D" & i ' (i is incresing in every step)
Range(record).Select
If Len(Selection.Hyperlinks(1).Address) > 0 Then (*)
link = Selection.Hyperlinks(1).Address
Else
link = ""
End If
But when there is no hyperlink it gives me the error: "subscript out of range" on the (*) line.
I tried using: Selection.Hyperlinks(1).Address <>""
Any idea?
Or maybe another code which gives me these hyperlinks?
Thank you,
Kenguru