Forum Discussion

Sylvia2047's avatar
Sylvia2047
Copper Contributor
Aug 29, 2022
Solved

How to compare hyperlinks

Hi all, I would like to pick your brains on how I could compare hyperlinks in 2 different cells.  The links that I want to compare are embedded links, i.e. the cell displays a set of texts (e.g. Com...
  • HansVogelaar's avatar
    Aug 29, 2022

    Sylvia2047 

    Create the following custom function in a module in the Visual Basic Editor:

    Function HyperlinkAddress(cell As Range) As String
        On Error Resume Next
        HyperlinkAddress = cell.Hyperlinks(1).Address
    End Function

    Let's say you have hyperlinks in A2 and down.

    Enter the following formula in B2, then fill down:

    =HyperlinkAddress(A2)

    You can then highlight duplicates in column B.

Resources