new to excel

B

baldwin

I am working with a large amount of information, one of which is names. I
need to know how many times a name, first and last is given in the
spreadsheet. The problem is that i have over 3000 names. Is there a way for
me to collect this information?
 
D

Don Guillett

Using the example from vba help index for FINDNEXT, modifided to find a in
col a and if b is in col b count it

Sub countmatches()
lr = Cells(Rows.Count, "a").End(xlUp).Row
With Range("a2:a" & lr)
Set c = .Find("a", LookIn:=xlValues)'last name
If Not c Is Nothing Then
firstaddress = c.Address
Do
If c.Offset(, 1) = "b" Then mc = mc + 1'first name
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
MsgBox mc

End Sub
 
Top