+ Reply to Thread
Results 1 to 7 of 7

Module to assign parent part to bill of materials

  1. #1
    Registered User
    Join Date
    10-21-2011
    Location
    Pacific NW, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Question Module to assign parent part to bill of materials

    I have a huge analysis I need to complete, and have a problem I think can only be solved via VB code. I have done limited VB coding in access but nothing in excel before, so hope someone could whip up something that would work and I can tinker with.

    The code would have to run down the column looking for the parent part identified as 0 in column B, and then copy the parent part number in Column C to Column A for each row that has a sub part number of that parent. There can be any number of sub components but the real signal to change the parent part number would be when it hits a row with another 0 in it.

    Any help here would be greatly appreciated.

    0 Parent Part Number
    1 Component 1 Part
    1 Component 1 Part
    2 Component 2 Part
    0 Parent Part Number
    1 Component 1 Part
    1 Component 1 Part
    2 Component 2 part
    3 Component 3 part
    Last edited by Tom_K!; 10-24-2011 at 03:35 PM. Reason: solved

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,672

    Re: Module to assign parent part to bill of materials

    Welcome to the forum.

    A workbook with some actual data and an example of desired output would be much easier to work with. The forum rules explain how to attach one.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-21-2011
    Location
    Pacific NW, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Module to assign parent part to bill of materials

    Here's a workbook. Thanks!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-21-2011
    Location
    Pacific NW, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Module/Macro to assign parent part to bill of materials

    Bump, no response. Also, This just has to be run once on each excel worksheet so that they become database importable, so maybe its a macro and not a module.

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2007 & reluctant Excel 2010 user
    Posts
    4,593

    Re: Module to assign parent part to bill of materials

    Based on your uploaded file you could perhaps do this:

    Copy value in E3 to A3.

    Then in cell A4 write this formula
    Please Login or Register  to view this content.
    and drag this formula down in column A.

    Alf

  6. #6
    Registered User
    Join Date
    10-21-2011
    Location
    Pacific NW, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Module to assign parent part to bill of materials

    Thanks, Alf. Somehow I missed it, but your idea worked perfectly.
    Last edited by Tom_K!; 10-24-2011 at 03:37 PM. Reason: solved

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2007 & reluctant Excel 2010 user
    Posts
    4,593

    Re: Module to assign parent part to bill of materials

    Glad to be of help and thanks for feed back.

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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