Try the code below, it's not as simple as I would like it to be, but it works.
Once you find that the current value entered in column "O" has a duplicate, I am using the Find
method to find the next match.
Code
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 15 And Len(Target.Value) > 0 Then
If Evaluate("Countif(O:O," & Target.Address & ")") > 1 Then
Range("P1").Value = "DUPLICATE ENTRY EXISTS"
Dim RowDup As Long
Dim FindRng As Range
Dim LastRow As Long
LastRow = Cells(Rows.Count, Target.Column).End(xlUp).Row ' get last row with data in Column "O"
If Target.Row = 1 Then
Set FindRng = Range(Cells(Target.Row + 1, Target.Column), Cells(LastRow, Target.Column))
Else ' define a search range, substract target cell from active range in column "O"
Set FindRng = Application.Union(Range(Cells(1, Target.Column), Cells(Target.Row - 1, Target.Column)), Range(Cells(Target.Row + 1, Target.Column), Cells(LastRow, Target.Column)))
End If
' find thr row number in the column O (except Target cell)
RowDup = FindRng.Find(What:=Target.Value, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Row
' get the hyperlink to the cell where the first dupliacte exists
Range("Q1").Formula = "=HYPERLINK(" & Range(Cells(RowDup, Target.Column), Cells(RowDup, Target.Column)).Address & ")"
End If
End If
Application.EnableEvents = True
End Sub