LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Cecking for duplicates

This code sets up a conditional format for column A (names in A2 onwards), I
set limit to row 500, change as required. Note: xl2007 version used.

Sub DuplicateConditional()
With Range("A2:A500") ' < set limit of your range here
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNTIF(A:A,A2)1"
.FormatConditions(.FormatConditions.Count).SetFirs tPriority
With .FormatConditions(1).Font
.Bold = True
.Color = -16776961
.TintAndShade = 0
End With
.FormatConditions(1).StopIfTrue = False
End With
End Sub

--

Regards,
Nigel




"MJKelly" wrote in message
...
Hi,

I have a column of data which needs to be checked for duplicates, how
would I do this with a macro? The data is a list of names which have
been assigned to tasks. I can't have the same person assigned to two
tasks/jobs. Would be great if the duplicates are shown in a different
colour once the macro is finished so I can make the necessary changes.

hope you can help.
Matt


 
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
Duplicates shaloy Excel Worksheet Functions 2 September 6th 08 07:25 PM
Condensing a list with duplicates to a list with non-duplicates Nuclear Excel Worksheet Functions 2 July 29th 08 08:03 PM
Duplicates in excel that aren't 100% DUPLICATES ... [email protected] Excel Discussion (Misc queries) 4 May 2nd 08 06:43 PM
Duplicates Guy Lydig Excel Discussion (Misc queries) 7 November 20th 07 04:40 AM
Duplicates Karen[_2_] Excel Worksheet Functions 4 April 18th 07 03:29 PM


All times are GMT +1. The time now is 09:40 AM.

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

About Us

"It's about Microsoft Excel"