Aug 29 2022 12:49 AM
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. Company A) and the texts are hyperlinked to a site (e.g. the website of Company A). What I want to do is to find any duplicate links in a column of cells with hyperlinked texts.
I have been trying conditional formatting to find duplicate cells, but it seems I can only compare the texts in the cells but not the links embedded to the texts?
Any idea?
Aug 29 2022 04:59 AM
SolutionCreate 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.
Aug 30 2022 01:39 AM
@Hans Vogelaar
Thank you very much! That's great help!
Aug 29 2022 04:59 AM
SolutionCreate 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.