1) Copy this code.
2) Right-Click the sheet tab of interest.
3) Select "View Code"
4) Paste the code into the window that appears.
5) Save the file as a macro-enabled .xlsm file.
6) Make changes as needed
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Application.CountIf(Target.EntireRow, Target.Value) > 1 Then
Application.EnableEvents = False
Application.Undo
MsgBox "Don't duplicate values in a row!"
Application.EnableEvents = True
End If
End Sub
Bookmarks