Hi
see if this is a start.
Sub aaa()
Sheets("address and vendor id").Activate
Range("A:J").Sort key1:=Range("A1"), order1:=xlAscending, key2:=Range("B1"), order2:=xlAscending, header:=xlYes
For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 1) = Cells(i - 1, 1) And IsEmpty(Cells(i, 2)) Then Cells(i, 2).Value = Cells(i - 1, 2).Value
Next i
Range("A1:J1").Copy Destination:=Range("L1")
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
If WorksheetFunction.CountIf(Range(Range("A1"), Cells(i, 1)), Cells(i, 1).Value) = 1 Then
Cells(i, 1).Resize(1, 10).Copy Destination:=Cells(i, "L")
Else
outrow = WorksheetFunction.Match(Cells(i, 1).Value, Range("A:A"), 0)
Cells(outrow, "U").Value = Cells(outrow, "U").Value & ", " & Cells(i, "J").Value
End If
Next i
End Sub
rylo
Bookmarks