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).SetFirstPriority
With .FormatConditions(1).Font
.Bold = True
.Color = -16776961
.TintAndShade = 0
End With
.FormatConditions(1).StopIfTrue = False
End With
End Sub
--
Regards,
Nigel
(E-Mail Removed)
"MJKelly" <(E-Mail Removed)> wrote in message
news:fc33706d-0f10-48f6-89af-(E-Mail Removed)...
> 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