+ Reply to Thread
Results 1 to 5 of 5

VBA Code for Demand calculation using multi level BOM

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Connecticut, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    VBA Code for Demand calculation using multi level BOM

    I have read various posts on related topics, but nothing quite fits my needs...

    I have a Multi Level BOM structure which is defined using a single level BOM table with three columns (Parent, Child, Qty per). Parts at any BOM level can have "Direct Demand" (e.g. from sales orders). In addition, parts (including sub-assemblies) have demand derived from the BOM relationships.

    So the INPUTS are (a) the Part Master with associated direct (sales) demand for each part and (b) the Single Level BOM table. The desired OUTPUT is aggregate demand for each part in the Past Master which is the sum of the Direct demand and the demand resulting from the BOM structure.

    Example is attached showing the Part Master/Demand, Single Level BOM structure and Desired Results.

    I am looking for a VB Macro that will process the INPUTS to create the OUTPUT.

    Many thanks for help on this....Einar
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: VBA Code for Demand calculation using multi level BOM

    It seems to me you should be using Access for this, not Excel.
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Code for Demand calculation using multi level BOM

    Hi

    I don't really understand why you need a macro.

    This is achievable using some formulas.

    So the sheet below does what you need using formulas.

    But if you add more data, you will need to modify the formulae.

    So I added a macro to update the formulae when you add or remove data.
    Attached Files Attached Files
    Last edited by mehmetcik; 09-12-2014 at 08:18 PM.

  4. #4
    Registered User
    Join Date
    09-11-2014
    Location
    Connecticut, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: VBA Code for Demand calculation using multi level BOM

    You may be right, but i'm a much more experienced Excel user....thanks!

  5. #5
    Registered User
    Join Date
    09-11-2014
    Location
    Connecticut, USA
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: VBA Code for Demand calculation using multi level BOM

    I'm new to this forum so maybe i'm missing something but I cannot seem to see your attached file. Additional info: the data I provided was simply a sample to establish the concept i need to deal with. The actual data will be queried from an ERP system and is several thousand records with BOMs that are up to 5 levels deep. If formulas can do the job, that's great. Some of the research I did indicted that a recursive macro (subroutine with a loop) was needed.

    Thanks for your help and i look forward to reviewing your suggested solution.

+ 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. Multi-level bar chart: is it possible? how?
    By s0050506 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-09-2014, 02:12 PM
  2. Bill of Materials conversion from multi level to single level
    By susmitpatel in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-11-2013, 12:53 AM
  3. Can't get VBA code to do task at worksheet level not workbook level
    By lealea1982 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-12-2011, 10:22 AM
  4. Multi level BOM
    By neorez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2010, 05:22 PM
  5. Using macro to convert single level BOM to Multi Level BOM
    By andrew_chong in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-07-2006, 04:57 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