I have a list of hundreds of companies in a column. There are repeat companies that were inputted differently. (i.e. "Nike" vs "Nike Inc")
I am trying to program a macro in excel to loop through the column to search for "Nike" and if found it will replace what is in that cell to a consistent company name (i.e. "Nike, Inc.") The goal would be to have the macro search for many companies.
I appreciate any help!
Here is an example for Nike and Ford
Sub Company()
ary = Array("Nike", "Ford")
Dim v As String, i As Long, j As Long
For i = LBound(ary) To UBound(ary)
v = ary(i)
For j = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If InStr(1, Cells(j, "A"), v) > 0 Then
Cells(j, "A") = v
End If
Next j
Next i
End Sub
Expand ary() as required.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments