Followup to "search range for duplicates"
I guess I didn't give enough info... I have a Named Range
for MondayNames, another for TuesdayNames, etc. All 5
Ranges are in Column A. Greg gave me this code which
works to find a duplicate, but it doesn't let me duplicate
names in Tuesday that I used in Monday. How can I
separate the search to work each range by itself?
The second problem I have is I don't know how to handle
the '..Select or ..Interior' I get a compile error.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
With Target
Set Rng = Columns(.Column)
If Application.CountIf(Rng, .Value) 1 Then
..Select
..Interior.ColorIndex = 6
MsgBox "Name already exists"
..Interior.ColorIndex = xlNone
End If
End With
End Sub
Thanks again for the help!!
|