I need to identify duplicate names and addresses in an Excel file.
I have the following syntax, which will highlight the specified text:
Dim strClient As String
strClient = Application.InputBox("Please enter a client name.", "Search for client name"
With Worksheets(1).Range("c1:c500"
Set c = .Find(strClient, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Pattern = xlPatternGray50
c.Interior.PatternColorIndex = 28
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Can anyone tell me how to count the number of records with the specified text, or identify duplicates, so I need not scroll through the entire file? This database will likely be populated with 5,000 records.
Many thanks.
I have the following syntax, which will highlight the specified text:
Dim strClient As String
strClient = Application.InputBox("Please enter a client name.", "Search for client name"
With Worksheets(1).Range("c1:c500"
Set c = .Find(strClient, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Interior.Pattern = xlPatternGray50
c.Interior.PatternColorIndex = 28
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Can anyone tell me how to count the number of records with the specified text, or identify duplicates, so I need not scroll through the entire file? This database will likely be populated with 5,000 records.
Many thanks.