Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check for duplicate entries

Hello,

Can anyone pls help me to solve the below
question?

I've 3 columns typed with IC No (Column C,E & G),
I want to check whether the IC No are duplicate in
these columns. If there is duplicate then highlight the
cell with interior.indexcolor, next duplicate with
difference color....

Thanks in advance.

Cstang



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Check for duplicate entries

Greg,

While some colors may be repeated, dpending on column, this quick and dirty solution below should help.

HTH,
Bernie
Excel MVP

Sub HighLightDuplicates()

Dim mycell As Range
Dim myRange As Range
Dim myRange2 As Range
Dim myCount As Integer

Set myRange = Intersect(ActiveSheet.UsedRange, Range("C:C,E:E,G:G"))
For Each mycell In myRange
If mycell.Value < "" Then
myCount = Application.CountIf(Range(myRange(1), mycell), mycell.Value)
If myCount 1 Then
mycell.Interior.ColorIndex = myCount + 1
End If
End If
Next mycell
End Sub

"cstang" wrote in message ...
Hello,

Can anyone pls help me to solve the below
question?

I've 3 columns typed with IC No (Column C,E & G),
I want to check whether the IC No are duplicate in
these columns. If there is duplicate then highlight the
cell with interior.indexcolor, next duplicate with
difference color....

Thanks in advance.

Cstang





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
Duplicate entries wally New Users to Excel 5 October 30th 09 04:47 AM
Check for duplicate entries in pull-down list bbarkman Excel Discussion (Misc queries) 1 May 12th 07 06:07 PM
check a list of numbers for duplicate entries in Excel Space Excel Discussion (Misc queries) 3 August 15th 06 05:51 PM
how can I check a worksheet for duplicate entries or numbers? RFI Excel Worksheet Functions 1 October 19th 05 04:08 AM
Duplicate entries DMC Excel Worksheet Functions 1 December 19th 04 07:45 PM


All times are GMT +1. The time now is 01:12 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"