+ Reply to Thread
Results 1 to 10 of 10

Populate multiples rows with data, then loop back and get next next row of input.

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Populate multiples rows with data, then loop back and get next next row of input.

    Hi all.
    I’m using Excel 2007
    I have a list on "Sheet3" that I need to draw data from.
    On sheet “sewer” I have a validation list in column B.
    I need to use the multiple values available in the validation list to place the appropriate rows from “sheet3” into rows in “sewer” starting at Q1. Comparing “sewer” column B with “sheet3” column F. In the real file the validation list expands out to over 300 items using a dynamic list validation.
    The idea being I can then use the results in a pivot table.
    The result I am chasing is on sheet “Explain”
    On “Explain” sheet columns B, C, D, E, F are from “sheet3”. G is from column C “sewer”, and H is E times G on this sheet.
    The excel file is an edited version of my real file, as the “sheet3” file is over 2500 rows long drawing the costs from a separate price list using multiple VLOOK ups over the row, then it calculates out the cells using =SUM(OFFSET(MATCH))), so I have left only values in the supplied file. I all so have “sheet3” used multiple times with different names.
    I am very new to excel, only knowing basic =SUM() functions before now. I have tried using the multiple consolidation ranges feature in pivot tables, but I am laid out wrong. Have tried VLOOKUP, INDEX and MATCH, complex arrays, all I did was confused myself.
    From what I can see it needs to be done with VBA and a macro that would clear the work are before inserting the data so it could be up dated, but I have no idea what to do in there. Can anybody please help me?


    examplesewer.xlsm

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Hi

    Ok try this

    1) Explain!E2: Change the heading to Quantity
    2) Sewer!B2: enter Markup
    3) Sewer!B2: Format Cells, Custom, ;;; This will have the effect of putting in a valid heading for an advanced filter, but you won't be able to see it.
    4) Right click on the Explain tab, view code, and paste in the code below
    Please Login or Register  to view this content.
    Not when you select the explain sheet, it will be updated based on your selections in sewer.

    HTH

    rylo

  3. #3
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Rylo,

    Thanks for the above

    I have sent you a PM

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Hi

    Next cut

    Please Login or Register  to view this content.
    rylo

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    @Bungslea: Please be sure to keep the Excel discussion fully in this thread, not in Private Messages, as per Forum Rules. Click on the FORUM RULES link above and read through them, you are expected to abide them. Thanks!
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Apologies Jerry

  7. #7
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Rylo,

    I did some more testing this afternoon.

    If I use the validation list to replace the content from “sewer” column B, it adds the new content to the sheet “Explain”, but also leaves the replaced content in “Explain” with #N/A in columns G and H.

    Any idea’s ?

    I would like to thank you again

    Bob

  8. #8
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Rylo,

    Stand down good sir, might be me at my end

    Let me check before you start looking at it

    Bob

  9. #9
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Ok, Apologies Rylo I did not have the validation list setup properly and that created its own errors.

    I have attached the working model of the original supplied, validation and all.

    The only way I seem to be able to “break it” now is if I remove a row from “sewer” then any rows below it are not seen on “explain”. This also means if I remove ALL the rows from “sewer” I still have all the rows in “Explain” but I have #N/A in columns G and H.

    Also, if I double up on an entry in “sewer”, “Explain” does not pick it up. Could it see the second instance and either add it to the first instance or just add it to the running list as a new line?

    Pushing my luck,
    Could both “sewer” and “Explain” tables reside on the same sheet as the each other? With “explain” data starting at AA2. The reason being, that I have multiple sheets with the “sewer” style data on it. This way I could place a pivot table on the same page. Using a macro I would step out of the sheet, back in again to refresh the data, and then refresh the pivot table all in the one action, keeping all the relative data in the one sheet.

    You have no idea how much I appreciate this.

    Thanks,
    Bob


    examplesewer (1).xlsm

  10. #10
    Registered User
    Join Date
    01-31-2013
    Location
    Brisbane, Australia. high and dry
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Populate multiples rows with data, then loop back and get next next row of input.

    Rylo,

    I have adjusted the above macro to have the results on the same sheet as the supplied data ("sewer" and "explain" are on the same sheet) and is working correctly, but I still have the error checking problems.

    The same as in the post above,

    “The only way I seem to be able to “break it” now is if I remove a row from “sewer” then any rows below it are not seen on “explain”. This also means if I remove ALL the rows from “sewer” I still have all the rows in “Explain” but I have #N/A in columns G and H.

    Also, if I double up on an entry in “sewer”, “Explain” does not pick it up. Could it see the second instance and either add it to the first instance or just add it to the running list as a new line?”

    The code is what I now have working.

    Are you able to help ??

    Please Login or Register  to view this content.

+ 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