LUp is a list of names. Unique, do dupes.
NmeRng is a list of names with many dupes of what is in the LUp list.
I want to count the number of times a name in LUp occurs in the list NmeRng and post it and the number of times it occurs in column M.
Like:
M. Mouse 8
D. Duck 11
Tom Saywer 4
etc.
This code attempt lists the name multiple times as M. Mouse 1, M. Mouse 2 and so on followed by the other names in same format.
Want one name and the number of times it occurs in NmeRng list.
Thanks.
Howard
NmeRng is a list of names with many dupes of what is in the LUp list.
I want to count the number of times a name in LUp occurs in the list NmeRng and post it and the number of times it occurs in column M.
Like:
M. Mouse 8
D. Duck 11
Tom Saywer 4
etc.
This code attempt lists the name multiple times as M. Mouse 1, M. Mouse 2 and so on followed by the other names in same format.
Want one name and the number of times it occurs in NmeRng list.
Code:
Option Explicit
Sub CountNameList()
Dim i As Long
Dim LUp As Range
Dim NmeRng As Range
Dim b As Range
Dim c As Range
Set LUp = Range("C1:C" & Range("C" & Rows.count).End(xlUp).Row)
Set NmeRng = Range("A1:A" & Range("A" & Rows.count).End(xlUp).Row)
For Each c In LUp
For Each b In NmeRng
If b.Value = c Then
i = i + 1
End If
Range("M2000").End(xlUp).Offset(1, 0) = b & " " & i
Next
Next
End Sub
Thanks.
Howard