Øyvind
Øyvind

Reputation: 979

Extracting the hyperlink from multiple cells with VBA

I want to iterate through a column, and extract each hyperlink to be used in the code (going to compare it to some text).

Any good pointers on how to do the extraction part?

Upvotes: 1

Views: 3269

Answers (1)

Siddharth Rout
Siddharth Rout

Reputation: 149295

You can use the .Hyperlinks(1).Address to get the Hyperlinks

For example this will extract the hyperlinks from A1 to A5

Sub Sample()
    Dim i As Long

    For i = 1 To 5
        Debug.Print Range("A" & i).Hyperlinks(1).Address
    Next
End Sub

Upvotes: 3

Related Questions