Aggregate Bill Of Material

Suhtka

New Member
Joined
Feb 19, 2016
Messages
8
Hi, I have a program that generates a cut list of materials depending on size and type of unit. Now the guys just take the files and manually aggregate it. I would like to do this programatically. I want to sum the quantity where the width, length, thick, and Matl. match. Red totals 20 parts. I would send the file but it seems I can't attach one.

Thank You!

ITEMQTYWIDTHLENGTHTHICKMATL
1423 42 13/16Solid Ash
2226 3/832 7/8 3/4Oak Ply
3216 3/432 7/8 3/4Oak Ply
42332 3/8 3/4Solid Ash
522 3/432 3/8 3/4Solid Ash
621 1/232 3/8 3/4Birch Ply
741 3/432 3/8 3/4Birch Ply
8429 1/21 1/4Hardwood
941 1/219 1/2 3/4Birch Ply
10214 1/229 3/8 1/2CDX Plywood
1423 42 13/16Solid Ash
2226 3/846 7/8 3/4Oak Ply
3216 3/446 7/8 3/4Oak Ply
42346 3/8 3/4Solid Ash
522 3/446 3/8 3/4Solid Ash
621 1/246 3/8 3/4Birch Ply
741 3/446 3/8 3/4Birch Ply
8429 1/21 1/4Hardwood
941 1/219 1/2 3/4Birch Ply
10214 1/243 3/8 1/2CDX Plywood
1823 42 13/16Solid Ash
2426 3/852 7/8 3/4Oak Ply
3416 3/452 7/8 3/4Oak Ply
44352 3/8 3/4Solid Ash
542 3/452 3/8 3/4Solid Ash
641 1/252 3/8 3/4Birch Ply
781 3/452 3/8 3/4Birch Ply
8829 1/21 1/4Hardwood
981 1/219 1/2 3/4Birch Ply
10414 1/249 3/8 1/2CDX Plywood
1823 42 13/16Solid Ash
2426 3/864 7/8 3/4Oak Ply
3416 3/464 7/8 3/4Oak Ply
44364 3/8 3/4Solid Ash
542 3/464 3/8 3/4Solid Ash
641 1/264 3/8 3/4Birch Ply
781 3/464 3/8 3/4Birch Ply
8829 1/21 1/4Hardwood
981 1/219 1/2 3/4Birch Ply
10414 1/261 3/8 1/2CDX Plywood

<tbody>
</tbody>
 
Last edited by a moderator:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this for results on sheet2.
Rich (BB code):
Sub MG03Nov36
Dim Rng As Range, Dn As Range, n As Long, txt As String, Ac As Long
Set Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
ReDim ray(1 To Rng.Count, 1 To 6)
With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
For Each Dn In Rng
    txt = Dn.Offset(, 2).Value & "," & Dn.Offset(, 3).Value & "," & _
        Dn.Offset(, 4).Value & Dn.Offset(, 5).Value
    If Not .Exists(txt) Then
        n = n + 1
        For Ac = 1 To 6
            ray(n, Ac) = Format(Dn.Offset(, Ac - 1), "@")
        Next Ac
        .Add txt, n
    Else
        ray(.Item(txt), 2) = ray(.Item(txt), 2) + Dn.Offset(, 1)
    End If
Next
End With
With Sheets("Sheet2").Range("A1").Resize(n, 6)
.Value = ray
 .Borders.Weight = 2
  .Columns.AutoFit
End With
End Sub
Regards Mick
 
Last edited by a moderator:
Upvote 0
Hi, I have a program that generates a cut list of materials depending on size and type of unit. Now the guys just take the files and manually aggregate it. I would like to do this programatically. I want to sum the quantity where the width, length, thick, and Matl. match. Red totals 20 parts. I would send the file but it seems I can't attach one.

Thank You!

ITEMQTYWIDTHLENGTHTHICKMATL
1423 42 13/16Solid Ash
2226 3/832 7/8 3/4Oak Ply
3216 3/432 7/8 3/4Oak Ply
42332 3/8 3/4Solid Ash
522 3/432 3/8 3/4Solid Ash
621 1/232 3/8 3/4Birch Ply
741 3/432 3/8 3/4Birch Ply
8429 1/21 1/4Hardwood
941 1/219 1/2 3/4Birch Ply
10214 1/229 3/8 1/2CDX Plywood
1423 42 13/16Solid Ash
2226 3/846 7/8 3/4Oak Ply
3216 3/446 7/8 3/4Oak Ply
42346 3/8 3/4Solid Ash
522 3/446 3/8 3/4Solid Ash
621 1/246 3/8 3/4Birch Ply
741 3/446 3/8 3/4Birch Ply
8429 1/21 1/4Hardwood
941 1/219 1/2 3/4Birch Ply
10214 1/243 3/8 1/2CDX Plywood
1823 42 13/16Solid Ash
2426 3/852 7/8 3/4Oak Ply
3416 3/452 7/8 3/4Oak Ply
44352 3/8 3/4Solid Ash
542 3/452 3/8 3/4Solid Ash
641 1/252 3/8 3/4Birch Ply
781 3/452 3/8 3/4Birch Ply
8829 1/21 1/4Hardwood
981 1/219 1/2 3/4Birch Ply
10414 1/249 3/8 1/2CDX Plywood
1823 42 13/16Solid Ash
2426 3/864 7/8 3/4Oak Ply
3416 3/464 7/8 3/4Oak Ply
44364 3/8 3/4Solid Ash
542 3/464 3/8 3/4Solid Ash
641 1/264 3/8 3/4Birch Ply
781 3/464 3/8 3/4Birch Ply
8829 1/21 1/4Hardwood
981 1/219 1/2 3/4Birch Ply
10414 1/261 3/8 1/2CDX Plywood

<tbody>
</tbody>
hi could repost or msg the working code please. i am getting error, subscript out of range
 
Upvote 0
If you are referring to the code in post#4 try copying it again, I have removed the bb code.
 
Upvote 0
Thanks Fluff, i tried, it worked. But not as desired. The output throws nearly 30 rows in sheet2, instead of summing up the qty of unique materials. Could you please check on this.
 
Upvote 0
In that case I suggest that you start a new thread, providing some more information, along with some data.
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

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