Hi, and welcome to the forum.
The way I usually trap this situation is to use a MATCH() function. So for example in your case in another cell named say 'Check" add
Formula:
=IF(ISERROR(MATCH(L12,Output!A:A,False)),"OK","Duplicate")
Then your macro is
Sub GENERATOR()
IF Range("Check") = "Duplicate" Then
MsgBox "There is a duplicate on the Output sheet. This record will not be added."
Exit Sub
End If
Range("L12").Copy
Sheets("OUTPUT").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial(xlPasteValues)
End Sub
Incidentally please remember to use code tags around any code you include as per the forum rules.
Bookmarks