combine similar rows

FuNeS13

Board Regular
Joined
Oct 25, 2016
Messages
160
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. Mobile
  3. Web
I have a sheet with the following columns and data:
SubCtSales Doc. ItemSaTyMaterialDescriptionOrder Quantity Net valueMat.Av.Dt.NameReq.dlv.dtSold-to ptName 1Deliv. date QuantityBUn
J123100ZORABCABC Item506,900.0010/12/2021Buyer110/4/2021321customer110/14/202120EA
J123100ZORABCABC Item506,900.0010/12/2021Buyer110/4/2021321customer110/14/202126EA


I want to be able to merge these rows (there is like 9k rows and not all of them will need to be merge) and sum the value on column O (painted green) "quanity"... (not order qty)...

so duplicates are removed except for the qty on column O which needs to be sum...

Anyone know how can this be done?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
That can be done with VBA.
Which column denotes whether a row should be merged?
 
Upvote 0
it's a combination of 3 minimum, B, C, and E, customer order, order line, and material... well maybe Column E can be omitted...
 
Upvote 0
Ok, how about
VBA Code:
Sub FuNeS()
   Dim Cl As Range
   Dim Tmp As String
   
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("B2", Range("B" & Rows.Count).End(xlUp))
         Tmp = Cl.Value & "|" & Cl.Offset(, 1).Value & "|" & Cl.Offset(, 2).Value
         If Not .Exists(Tmp) Then
            .Add Tmp, Cl
         Else
            .Item(Tmp).Offset(, 13).Value = .Item(Tmp).Offset(, 13).Value + Cl.Offset(, 13).Value
            Cl.Value = ""
         End If
      Next Cl
   End With
   Range("B:B").SpecialCells(xlBlanks).EntireRow.Delete
End Sub
 
Upvote 0
Solution
amazing, works perfectly!!! thank you very much for your great help, we (at work) really appreciate your support.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,960
Messages
6,122,479
Members
449,088
Latest member
Melvetica

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top