How do I prevent duplication of numbers in a column

W

waldo

I am entering numbers in a column and it is important that I get alerted to
any duplication of a previous number. How do I do this?
 
D

Don Guillett

right click sheet tab>view code>insert this>modify for your column>SAVE

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
If Application.CountIf(Columns(2), Target) > 1 Then MsgBox "Dup"
End Sub
 
Top