Hi Dan1027,
Please try the following macro. It loops thru all names in 1A tab and store information for each of them in a dictionary, the output the result to 1B tab
Sub CleanUpNames()
Dim wsD As Worksheet
Dim wsO As Worksheet
Dim ar, x()
Dim i As Integer, j As Integer
Dim Dic, b
Dim sFullName As String
Dim rg As Range
Set Dic = CreateObject("scripting.dictionary")
Set wsD = Worksheets("1 A") 'Data sheet
Set wsO = Worksheets("1B") 'Output sheet
On Error Resume Next
wsD.ShowAllData
On Error GoTo 0
Set rg = wsD.Cells(1).CurrentRegion
ar = rg.Value
'/Get Data
For i = LBound(ar, 1) To UBound(ar, 1)
sFullName = ar(i, 1) & ar(i, 2)
If Not Dic.exists(sFullName) Then
ReDim x(1 To 8)
Dic(sFullName) = Array(8)
For j = 1 To 8
If ar(i, j) <> "" Then x(j) = ar(i, j)
Next j
Dic(sFullName) = x
Else
x = Dic(sFullName)
For j = 1 To 8
If ar(i, j) <> "" Then x(j) = ar(i, j)
Next j
Dic(sFullName) = x
End If
Next i
'/Output data
wsO.Cells(1).CurrentRegion.Clear 'Delete Previous results
b = Application.Transpose(Dic.items)
wsO.Range("A1").Resize(Dic.Count, 8) = Application.Transpose(b)
End Sub
Bookmarks