+ Reply to Thread
Results 1 to 4 of 4

Using SumIf & VBA to Account for Multiple Instances of Same Part # in Bill of Materials

  1. #1
    Registered User
    Join Date
    07-24-2021
    Location
    USA
    MS-Off Ver
    Windows 10
    Posts
    1

    Using SumIf & VBA to Account for Multiple Instances of Same Part # in Bill of Materials

    Hello,

    Attaching a sample workbook to give an idea of what I am trying to accomplish - trying to use the SumIf function via VBA to help automate a build / bill of materials (BOM) process that allows us to figure out how many of each part we need to order for an upcoming build. In our BOM, we use the same part in different subassemblies, meaning the same part may show up multiple times throughout the entire BOM with a different pick quantity for each subassembly. i.e. we might use 1 given resistor in 1 subassembly and 2 more in a separate subassembly for the same build. Reason we would like to automate this is so that when we have future orders, we want to enter Build Quantity and have the sheet display how many of each unique part we need to order, accounting for all instances of each part across the subassemblies.

    Below in some word math:
    total BOM quantity of a specific part number = pick quantity of said part in subassembly 1 + pick quantity of same part in subassembly 2 + ...

    number to order = total BOM quantity of said part number - current inventory quantity on hand

    I am using a For loop to iterate through the part numbers in a given BOM and understand (I think) the SumIf function is what I need. But then once all instances of a part have been found and the # to order is determined, as the loop iterates through the remaining part numbers it will also need to skip the lines of part numbers that have already been accounted for above. Does this make sense? Attaching sample workbook for reference. Thank you in advance for any feedback / direction - greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Using SumIf & VBA to Account for Multiple Instances of Same Part # in Bill of Material

    Is it simply like this?
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Using SumIf & VBA to Account for Multiple Instances of Same Part # in Bill of Material

    What about Pivot Table, see file attached
    Attached Files Attached Files
    Last edited by PCI; 07-25-2021 at 05:52 AM.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,470

    Re: Using SumIf & VBA to Account for Multiple Instances of Same Part # in Bill of Material

    @kbm234

    Windows 10 is your OS, not your Office version - please update your profile.: )
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Bill of Materials
    By DennisWA in forum Excel General
    Replies: 7
    Last Post: 11-27-2017, 06:05 PM
  2. Condensing Bill of Materials
    By AndyStanton in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-23-2016, 12:11 PM
  3. BOM (Bill of Materials) Explosion
    By AndySimm2000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2016, 06:06 AM
  4. Module to assign parent part to bill of materials
    By Tom_K! in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-25-2011, 12:49 AM
  5. Bill of materials form
    By JESSIER4025 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-08-2010, 08:38 PM
  6. Bill of Materials
    By tonyhindmarsh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2007, 05:37 AM
  7. bill of materials
    By stevekirk in forum Excel General
    Replies: 7
    Last Post: 12-10-2006, 05:12 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