I entered a list of inventory, but i have multiple duplicates and I will like to combine them. I want them to be combined with the qty listed in the next row.
I entered a list of inventory, but i have multiple duplicates and I will like to combine them. I want them to be combined with the qty listed in the next row.
You gave insufficient data to write and test this in Excel, so... Copy the list to a blank sheet then select the top item in the list before running this code. Note, this code asssumes that your list is only two columns, you may have to edit it to suit otherwise.
Sub ConsolidateAndDelete()
Dim Cel As Range
Set Cel = Selection
Do While Cel.Offset(1) <> ""
Do While Cel.Offset(1) = Cel
Cel.Offset(0, 1) = Cel.Offset(0, 1) + Cel.Offset(1, 1)
.Offset(1).Resize(0, 2).Delete Shift:=xlShiftUp
Loop
Set Cel = Cel.Offset(1)
Loop
End Sub