compare cells in a column for duplicates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

As I enter in company names into column B in my worksheet I would like a
macro to automaticlly check to see if I have a duplicate name already entered
and if so show it in a pop-up windows as an error. Now I thought a Loop If
statement would work however if memory serves me correct I would have to
enter all the names in my statement. Any assistance would be appreciated.
Thanks
 
I think macro is good option but you can achieve something simiar with
conditional formatting. Essentially, the conditional formatting will
highlight the entered name, if it has been already entered.

Select the range where you will be entering the data
goto Format-->Conditional Formatting
From the drop down select 'Formula Is'
Enter the formula as =IF(COUNTIF($A$1:$A$20,A5)>1,1,0)
Set the color pattern

Here you can change the range from A1:A20 to your actual range.

HTH,
 

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

Back
Top