+ Reply to Thread
Results 1 to 9 of 9

aaaaaa

Hybrid View

  1. #1
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    aaaaaa

    aaaaaaaaaaaaa
    Attached Images Attached Images
    Last edited by hejszyszki; 05-13-2021 at 09:46 AM.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: Complex Bill of Material

    Check yellow banner at the top of the page. Attach small sample file. It can be also helpful if you place expected result down there.

    < LANG pl=ON>Witam na forum< /LANG pl=OFF>
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    Re: Complex Bill of Material

    Hi kokosek,

    My bad not noticing the rules. There is a sample file.

    My idea is that user inputs Parent code & value in sheet PLAN. Then macro is looping through BOM page to find all components of parent material and output it to OutputSheet. Then a simple calculation that im able to do by myself.
    Just cant get through decomposing whole parent mat.

    Data exported to this file is in sheet BOM & output in sheet Output.

    Any ideas?

    Thanks in advance!
    Attached Files Attached Files

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: Complex Bill of Material

    In you example data in Output, imho, does not matching with BOM data.

    B
    C
    D
    1
    Parent desc Mat type Component
    6
    Item 1 C
    3.1
    7
    Item 1 C
    3.2
    Sheet: Output

    B
    C
    D
    1
    Parent Desc Component Comp Desc
    10
    Comp 4
    3.1
    Comp 9
    11
    Comp 4
    3.2
    Comp 10
    Sheet: BOM

  5. #5
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    Re: Complex Bill of Material

    That is the thing with multi-level BOM. Components might be done also by few other materials thats why it is called as parent in BOM. Thats the trick of extract i have. On the other hand in Output you have Parent-parent item that is made of few components, and those components might be done by another components. So there is fully finished item that is made of Comp 1,2,3,4 and Comp 4 is made of Comp 9 and Comp 10. Comp 10 can be made of Comp 11,Comp 12 etc. Thats why in output there is Item 1 in B column.

    Does it make sense?

    Thanks in advance!

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: Complex Bill of Material

    As I understand that you want to generate requirement for particular components based on req qty of FG.
    I know how the BoM works. But I do not get how/why do you want to remove 'levels' of BoM.

  7. #7
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    Re: Complex Bill of Material

    Yes, your understanding is very correct
    First of all i do not see the way to separate output when user would require more than one item and on the other hand levels are not so necesarry for me and i do not have levels in extract, so i do not know how to associate them automatically since portfolio of products is dynamic. That was my idea, now i see your point as well as an option. Both options seems reasonable tbh ...

    Also, one component can be lvl 3 of item 1 and lvl 5 of item 2 no?

    Thanks in advance!
    Last edited by hejszyszki; 05-08-2021 at 01:48 PM.

  8. #8
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    Re: Complex Bill of Material

    Hey kokosek,

    Ive been able to achieve multi-level explosion of FG, but no idea how to output also mid-lvl components. Anywhere i edit the code it triggers errors. Also if i try to make the calculation for output in the code it outputs mismatch error, so i left it as quantities for now. The code outputs lowest lvl components and its quanitites. Also how can i make Period inputs recursive? So i do not need to copy paste this code just to refer different cell of input.. Any ideas, help?




    Sub BomExplosion()
    
    Dim ModelCol As Range
    Dim ModelQntyCol As Range
    Dim ParentCol As Range
    Dim Childcol As Range
    Dim ChildQuantCol As Range
    Dim ModelOutCol As Range
    Dim PartCol As Range
    Dim PartQntCol As Range
    Dim BaseQty As Range
    
    Set ModelCol = Sheets("PLAN").Columns("A")
    Set ModelQntyCol = Sheets("PLAN").Columns("D")
    Set ParentCol = Sheets("BOM").Columns("A")
    Set Childcol = Sheets("BOM").Columns("C")
    Set ChildQuantCol = Sheets("BOM").Columns("E")
    Set ModelOutCol = Sheets("Output").Columns("A")
    Set PartCol = Sheets("Output").Columns("D")
    Set PartQntCol = Sheets("Output").Columns("F")
    
    
    Const StartDataRow = 2
    SummaryRowCount = StartDataRow
    
    Lastrow = ParentCol.Cells(Rows.Count, 1).End(xlUp).Row
    
    
    Set ParentRange = ParentCol
    Set ChildRange = Childcol
    Set TopLevelPart = ModelCol
    
    For RowCount = StartDataRow To Lastrow
     Child = Childcol.Cells(RowCount, 1)
     
     Set c = ParentRange.Find(what:=Child, LookIn:=xlValues, lookat:=xlWhole)
     If c Is Nothing Then
      ChildQuant = ChildQuantCol.Cells(RowCount, 1)
      
      PartParent = ParentCol.Cells(RowCount, 1)
      
      
      Do
       Set c = ChildRange.Find(what:=PartParent, LookIn:=xlValues, lookat:=xlWhole)
       If Not c Is Nothing Then
       Quant = ChildQuantCol.Cells(c.Row, 1)
       ChildQuant = ChildQuant * Quant
       PartParent = ParentCol.Cells(c.Row, 1)
       End If
      Loop While Not c Is Nothing
      
      
      Set c = TopLevelPart.Find(what:=PartParent, LookIn:=xlValues, lookat:=xlWhole)
      If c Is Nothing Then
       MsgBox ("Cannot find top Level Part : " & PartParent)
      Else
       Quant = ModelQntyCol.Cells(c.Row, 1)
       ChildQuant = ChildQuant * Quant
       ModelOutCol.Cells(SummaryRowCount, 1) = PartParent
       PartCol.Cells(SummaryRowCount, 1) = Child
       PartQntCol.Cells(SummaryRowCount, 1) = ChildQuant
       SummaryRowCount = SummaryRowCount + 1
      End If
     End If
    
    Next RowCount
    
    
    End Sub
    thanks in advance!

  9. #9
    Registered User
    Join Date
    05-07-2021
    Location
    Warsaw
    MS-Off Ver
    MS365
    Posts
    20

    Re: Complex Bill of Material

    Hi,
    I managed to solve problem with calculation by adding PerQty column to BOM Sheet and refering to it in code. For now it is just to output mid-lvl components, and eventually add an option for providing multiple periods.

    Edited code & example within attached file.

    I will be gratefull for any help

    Thanks in advance!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculate Material Release - Bill of Material
    By mgoh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2021, 06:40 AM
  2. Copy down cells with SKU IDs in a Bill-of-Material
    By anasman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2017, 04:45 PM
  3. Multi level Bill of material
    By neorez in forum Excel General
    Replies: 36
    Last Post: 03-09-2016, 02:05 AM
  4. general bill of material
    By francesco.ciani88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-26-2015, 02:04 PM
  5. [SOLVED] Bill of Material Data Look up issue
    By jacob@thepenpoint in forum Excel General
    Replies: 7
    Last Post: 05-07-2013, 11:06 AM
  6. Hide sheets in a Bill of Material
    By ajbele in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2013, 06:13 PM
  7. bill of material, assemblies
    By jamesw in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2011, 01:53 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1