Restrict a column to allow for unique entries only?

  • Thread starter Thread starter Gabe
  • Start date Start date
G

Gabe

I have an Excel table linked to Access. I would like to
restrict one column to require all entries to be unique.
Is there a way to do this?
 
Hi Gabe
you can use Data - Validation for this:
Select all your cells in this column (assumption: column A, starting in
row 1) and enter the following formula in the validation dialog:
=COUNTIF($A$1:$A$999,A1)=1

Frank
 
Thanks Everybody,
I really need something that will warn me if there is
duplication occuring as I'm pasting values into cells.
Is there a way to make this work? Sorry, I should have
pointed that out more strongly earlier.
 
I really need something that will warn me if there is
duplication occuring as I'm pasting values into cells.
Is there a way to make this work? Sorry, I should have
pointed that out more strongly earlier.
...

Data validation isn't triggered by pasting into cells. It only works upon actual
entry using keystrokes ending with [Enter] or [Ctrl]+[Shift]+[Enter]. If you'd
be pasting data, you need to use a Change or SheetChange event handler macro.
Such a macro could go through the cells entered prompting you for changes when
invalid entries are encountered.

What would you want to happen when an invalid entry was made? Note that there's
no way to *prevent* invalid *pasted* entries. It's only possible to deal with
them after the fact.
 
Back
Top