+ Reply to Thread
Results 1 to 6 of 6

Return multiple rows of data based off export & insert line

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    77

    Return multiple rows of data based off export & insert line

    Hi all, I cannot come up with a formula to do what I need and I'm still very new to VBA - so I'm not sure how to achieve this..

    Basically I have an export which has a bunch of info I need summarised. Attached is an example. We have 6 different Production Lines that each of these BOM's (Bill of Materials) are for, and a list of all work order numbers (172****) associated with that line. For this export I have just got lines 1, 2 & 3 (I'm sure I can modify the code for the other 3 lines if I have a starting point).

    The tab 'BOMData' has all of the data from the export. For each work order number will be a list of materials that go with that order (can range from a couple materials through to 7+ materials)

    The tab 'BOMsAuto' is how I need it to be set up. Basically for each work order number, it would list all of the ingredients, then put a blank line in where the next work order is different, so forth and so on.

    On the 'BOMsAuto' tab is a list of Work Orders (column G for Line 1) which is the order in which I need the BOM's to appear so that it's accurate. I tried using VLOOKUP to start with, but it won't go to the next line once completed and won't adjust when there are more materials on a particular order - it also doesn't incorporate an extra line between work orders. Is there a way to do this automatically, or to tie in with a macro?

    Thank you so much for your time and help. It's Monday and my brain has stopped working completely.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-04-2014
    Location
    Europe
    MS-Off Ver
    2007
    Posts
    107

    Re: Return multiple rows of data based off export & insert line

    Hi
    This isn't a VBA solution, but it is a start.
    I have attached a sheet that will retrieve the Work Order BOMdata data as you want.
    However there is a problem;
    if I am correct in my guess that the length of returned materials list is not constant, then I do not know a way to have the formula return all results for the first Order Number and then leave a blank line and repeat the process for the second Order number.

    Hope this is some help :-)

    Regards
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Return multiple rows of data based off export & insert line

    Thanks Bobsone, that certainly gives me something to work with. You are absolutely correct that the amount of lines to be returned are not constant, and thus does not provide a 'line' to separate the materials, but it's certainly more automatic than it was before. Thanks once again, Bobsone. +rep for you.

    If anyone else has any solutions, feel free to share

    Cheers.

  4. #4
    Forum Contributor
    Join Date
    10-04-2014
    Location
    Europe
    MS-Off Ver
    2007
    Posts
    107

    Re: Return multiple rows of data based off export & insert line

    Hi
    Thanks for the feedback, hopefully a complete solution can be found.
    How do you generate the PO values in G2:G7, O2:O6 etc?

    Regards

  5. #5
    Registered User
    Join Date
    01-09-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Return multiple rows of data based off export & insert line

    Hey Bobsone.

    The PO values are generated from our scheduleof work orders. I just copy and paste them to that location, then use them to generate my report out of SAP/reference which order the results should return with.

    The export then pastes in and the results come back. I am continuing to work with the solution you've posted, and am hoping I can create a macro afterwards which will neaten up the results.

  6. #6
    Forum Contributor
    Join Date
    10-04-2014
    Location
    Europe
    MS-Off Ver
    2007
    Posts
    107

    Re: Return multiple rows of data based off export & insert line

    Hi
    This might help to automatically extract PO numbers which are specific to each "Line" category.
    The cell reference $F$1 near the end is for a specific Line value.
    It is an array formula so it will need to be entered with cntrl-shift-enter then drag it down the column as far as required.

    =IFERROR(INDEX(BOMData!$D$2:$D$95;MATCH(0;COUNTIF(A$1:A1;BOMData!$D$2:$D$95)+IF(BOMData!$A$2:$A$95<>$F$1;1;0);0));"")
    Last edited by Bobsone; 03-11-2015 at 12:17 AM.

+ 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] Insert Multiple Rows Based Off Number in Cell and Copy Data From Above New Rows
    By tstell1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 04:15 PM
  2. [SOLVED] Fetch Data: Return Multiple Rows based on Cell Content
    By pdreyest in forum Excel General
    Replies: 8
    Last Post: 09-24-2012, 12:43 AM
  3. Insert Line Every Other Row w/Multiple Formulas based on Line Above
    By xyshel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2011, 11:09 AM
  4. vlookup formula to return multiple rows of data based on the same value.
    By Point5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2011, 06:03 PM
  5. [SOLVED] return multiple rows of data based on criteria
    By steve_sr2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-28-2006, 12:15 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