I'm working on compiling BOM's for electrical equipment. I've got a total of 18 BOMS with about 160 items each. I'm looking for a code that will scan through all of the data and identify duplicates, take their values, add them up, then delete the duplicates. This code I have identifies and deletes but I cant get it to add up the quantities...
Sub RemoveDuplicates()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For x = lastrow To 1 Step -1
For y = 1 To lastrow
If Cells(x, 1).Value = Cells(y, 1).Value And Cells(x, 2).Value = Cells(y, 2).Value And x > y Then
Cells(y, 3).Value = Cells(x, 3).Value + Cells(y, 3).Value
Rows(x).EntireRow.Delete
Exit For
End If
Next y
Next x
End Sub