Duplicates

K

KKD

Is there a way to be flagged when adding a duplicate record. My spreadsheet
is set up with records in rows...I want to know when I am entering a
duplicate invoice number, which is a value stored in a single column of the
row. I want to be allowed to enter duplicates, I just need to know that it IS
a duplicate. Any suggestions?
 
D

Don Guillett

One way. Right click sheet tab>insert this>change column 1 to suit yours

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
lr = Cells(Rows.Count, 1).End(xlUp).Row
If Application.CountIf(Range(Cells(1, 1), _
Cells(lr, 1)), Target) > 1 Then MsgBox "Dup"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top