Thread: Duplicates
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Duplicates

This change allows for partial matches
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < Range("b1").Address Then Exit Sub
If Not Columns(1).Find(Target, lookat:=xlWhole) Is Nothing Then Exit Sub
Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = Target
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
Right click sheet tabcopy paste this. Now when you put something in cell
b1 it will be added to the end of column A UNLESS it already exists in
column A

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < Range("b1").Address Then Exit Sub
If Not Columns(1).Find(Target) Is Nothing Then Exit Sub
Cells(Cells(Rows.Count, 1).End(xlUp).Row + 1, 1) = Target
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Dias" wrote in message
...
Hello!
I am looking for a formula that prevents the entry of duplicates.
Not insert a value in cell B1 when the value already exists in column A.
Any idea?
Thanks