Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default compare cells in a column for duplicates

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default compare cells in a column for duplicates

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,
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"Mekinnik" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default compare cells in a column for duplicates

Take a look at this page:

http://www.cpearson.com/Excel/Duplicates.aspx
and this page
http://www.cpearson.com/excel/NoDupEntry.aspx

--
Regards,
Tom Ogilvy


"Mekinnik" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
compare 2 column cells and return the adjacent columns cells data of the cell trebor57 Excel Worksheet Functions 1 February 1st 11 02:54 PM
Compare 1 cell to column of cells returning adjacent cells info? Mr. Fine Excel Worksheet Functions 1 April 15th 10 07:36 PM
Counting Cells in a column depending on another column but excluding duplicates rwenger Excel Discussion (Misc queries) 0 April 11th 10 01:06 PM
compare data in column A with column B to find duplicates George Excel Discussion (Misc queries) 8 February 6th 09 03:53 PM
compare cells in column to criteria, then average next column cell Bradwin Excel Worksheet Functions 2 July 21st 08 08:37 PM


All times are GMT +1. The time now is 01:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"