Hi, Greg. This isn't exactly what you're asking for, but
it's a useful little duplicate-finder macro that I put in
my Personal.xls because I use it all the time. Starting
at the top of any continuous column of data, it inserts a
new column and fills it with either "UNIQUE" (for the
first occurrence) or "DUPLICATE" (for second and
subsequent occurrences). At the end it gives a message
box showing items evaluated and count of unique items.
Maybe you can massage it into something that'll solve your
problem.
########################################################
Sub Duplicates()
Dim strValArray() As String
Dim lngCounter As Long
Selection.EntireColumn.Insert
ReDim strValArray(0)
strValArray(0) = ActiveCell.Offset(0, 1).Value
ActiveCell.Value = "Unique"
lngCounter = 1
Do While ActiveCell.Offset(1, 1).Value > ""
ActiveCell.Offset(1, 0).Select
'FindDups
Dim x As Long
x = 0
Do Until ActiveCell.Value = "Duplicate" Or x =
UBound(strValArray) + 1
If strValArray(x) = ActiveCell.Offset(0,
1).Value Then
ActiveCell.Value = "Duplicate"
Else
x = x + 1
End If
Loop
If ActiveCell.Value <> "Duplicate" Then
ReDim Preserve strValArray(UBound(strValArray)
+ 1)
strValArray(UBound(strValArray)) =
ActiveCell.Offset(0, 1).Value
ActiveCell.Value = "Unique"
End If
lngCounter = lngCounter + 1
Loop
MsgBox ("Items checked = " & lngCounter & ", Unique
Count = " &
UBound(strValArray) + 1)
End Sub
######################################################