Thread: No duplicates
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sharad Sharad is offline
external usenet poster
 
Posts: 123
Default No duplicates


Put this in your TextBox change or, Command button click proedure (which
ever you are using to put the data in to the sheet.)

With Worksheets("Blends Produced")
For Each c In .Range("A1:A" & .Range("A1").End(xlDown).Row).Cells
If c.Value = Textbox1.Value Then
MsgBox "The value you entered already exists." _
& Chr(13) & "Please enter another value."
Textbox1.Value = ""
Textbox1.SetFocus
Exit For
End If
Next c
End With


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!