Home » excel » excel – Extracting the hyperlink from multiple cells with VBA

excel – Extracting the hyperlink from multiple cells with VBA

Posted by: admin May 14, 2020 Leave a comment

Questions:

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?

How to&Answers:

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