My excel sheet looks like this
c1 c2 c3 c4
ROW1 abc def 1 2
ROW2 abc def 3 4
ROW3 klm e
You can do this using the excel concatenate function. Here's a link to a good tutorial
Also, to deal with the duplicates, you can have excel highlight duplicate entries so they can be easily deleted. See here
This code will
Sub QuickCombine()
Dim X()
Dim Y()
Dim objDic As Object
Dim lngRow As Long
Dim lngCol As Long
Dim ws As Worksheet
X = Range([a1], Cells(Rows.Count, "D").End(xlUp))
Y = X
Set objDic = CreateObject("scripting.dictionary")
For lngRow = 1 To UBound(X, 1)
If Not objDic.exists(LCase$(X(lngRow, 1) & X(lngRow, 2))) Then
objDic.Add LCase$(X(lngRow, 1) & X(lngRow, 2)), lngRow
Else
Y(lngRow, 1) = vbNullString
Y(objDic.Item(LCase$(X(lngRow, 1) & X(lngRow, 2))), 3) = Y(objDic.Item(LCase$(X(lngRow, 1) & X(lngRow, 2))), 3) & "," & X(lngRow, 3)
Y(objDic.Item(LCase$(X(lngRow, 1) & X(lngRow, 2))), 4) = Y(objDic.Item(LCase$(X(lngRow, 1) & X(lngRow, 2))), 4) & "," & X(lngRow, 4)
End If
Next
Set ws = Sheets.Add
ws.[a1].Resize(UBound(X, 1), UBound(X, 2)) = Y
ws.Columns("A").SpecialCells(xlBlanks).EntireRow.Delete
End Sub