+ Reply to Thread
Results 1 to 6 of 6

Sort and tally bill of materials

  1. #1
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115

    Sort and tally bill of materials

    Hi,

    I need help with a macro to sort and tally components listed in a bill of material for a printed circuit board. On the attached workbook, in columns A:F is the bill of materials as output by the schematic capture software.

    Unfortunately, this format is difficult to use for ordering components. An example of the format that I need is shown in columns I:O. Basically, the reference designators of all components with the same part value are placed in a single cell as shown cells I7 and I8. An additional column, column O tallies the number of components with the same part value.

    Columns J:N would simply copy the component information from columns B;F.

    I could probably do this manually , however, I need to ensure correct quantities are ordered. This is a small bill of materials. I have several others for which I need to do the same that have over a hundred components.

    Can anyone in the Forum help with a macro that can sort and tally as described above?

    Thanks,

    Art
    Attached Files Attached Files
    Last edited by ArtZ; 08-18-2015 at 06:51 PM.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Sort and tally bill of materials

    this looks like it works....it's a little more funky than I prefer but it works for small files....

    I just take the partnumbers and use remove duplicate function in XL and use that list to loop through and collect data....

    I suppose technically you don't have to clear each variable in the loop, but I do it because I get to choose what it is, instead of XL potentially choosing something weird...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Sort and tally bill of materials

    Hi Art,

    Try the following code which is included in the attached file.

    In an ordinary code module such as Module1:
    Please Login or Register  to view this content.
    Lewis

  4. #4
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115

    Smile Re: Sort and tally bill of materials

    Hi Ernest,

    Great job. Thanks, works exactly as I expected. Much appreciated!

    Art

  5. #5
    Forum Contributor
    Join Date
    01-07-2006
    Location
    San Jose, CA
    MS-Off Ver
    2007, 2016
    Posts
    115

    Red face Re: Sort and tally bill of materials

    Hi Lewis,

    Great job as well. Thanks! Double thanks for adding the command buttons and stats tally.

    Art

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Sort and tally bill of materials

    Hi Art;

    Thanks for setting the thread to Solved...If you feel we deserve an increase in our reputation, feel free to click on the star in the lower left of the thread. Remember, someday when you help somebody they may add to your rep points, and it could be one of us...just a thought...and have a great day

+ 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. Help with Designing a Bill of Materials!
    By blakewalker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2012, 11:52 AM
  2. Bill of materials for Aluminium Windows
    By tfnduarte in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-02-2010, 05:05 AM
  3. Bill of materials form
    By JESSIER4025 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-08-2010, 08:38 PM
  4. Bill of Materials Comparison Macro
    By r0cket88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-23-2008, 10:54 AM
  5. Bill of Materials
    By tonyhindmarsh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2007, 05:37 AM
  6. bill of materials
    By stevekirk in forum Excel General
    Replies: 7
    Last Post: 12-10-2006, 05:12 PM
  7. [SOLVED] Bill of Materials / Router
    By MStim in forum Excel General
    Replies: 0
    Last Post: 09-14-2005, 10:05 AM

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