+ Reply to Thread
Results 1 to 13 of 13

Compile data from one sheet to another

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Question Compile data from one sheet to another

    Hello all you excel experts!
    I know my question is not a hard one for those of you out there with great skills, but I can't get this done by my self (tearing my hair of soon! )

    I have an example list that I made to simulate my problem. In sheet1 (Products) there is a list of products (fruits) and sheet two (Order) is like an order confirmation. Lets say i fill out the first sheet with the different quantities a customer want to order. I would like to have this productorder automatically compiled in a nice list with total cost summarized at the bottom of the order sheet when the order sheet is opened. I attached the file for you to have a go at =)

    There may offcourse be a question similar to min already answered, but I could not find one =( If possible please guide me.

    Compile-test-file.xlsx
    Many, many thanks from a desperate girl!
    Last edited by GoCrazyGirl; 12-03-2013 at 04:35 PM.

  2. #2
    Forum Contributor vamosj's Avatar
    Join Date
    04-23-2004
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    294

    Re: Compile data from one sheet to another

    Is this what you are looking for?

    This allow you to just place the item on the summary along with the quantity and have it autoupdate.
    If it is from the product page it will require quite a bit more coding of the formula.
    If it is a macro you want, then that can be done easily also, but I think the formula use on the summar sheet would work a lot better without the need for macros.

    Cell E20
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Also put a dropdown menu in your product area for easy access of the product list.
    Attached Files Attached Files
    Last edited by vamosj; 12-03-2013 at 05:28 PM.
    Janos S. Vamos
    Data Systems Technician/Fire Controlman PO1(SW/AW)
    US Navy Retired


    Remember, Record Macro can be your friend for figuring out solutions.

    Good or Bad, let me know how I did by clicking on the "Add Reputation" * just to the lower left of here. it only takes a few seconds to let someone know.

  3. #3
    Forum Contributor vamosj's Avatar
    Join Date
    04-23-2004
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    294

    Re: Compile data from one sheet to another

    To follow up on my previous, I've adjusted the summary sheet (not sure how much fruit a place orders) to allow for 20 products.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,743

    Re: Compile data from one sheet to another

    Try this:

    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Compile data from one sheet to another

    Thank you Janos, for taking your time to reply. However this superb little dropdown feature does not quite cut my needs. The scenario is rather that a customer would order lets say 15 different fruits and I want these 15 displayed as rows on the ordersheet and these 15 costs summarized at the bottom. I later use this order sheet to save as a pdf and email to the customer (have a nice macro for that already ;-) so I don't benefit from dropdowns at this point.

    I would like a macro that loops through the productsheet B column looking for values >0 and copy those rows, than go to the ordersheet to insert these rows below row 20, however many these may be.

    Manually I would use a filter to filter out these orders in the product sheet and copy paste the rows to the order sheet, but the point of macros is having things automated right ;-)

    Any idea on how to do this?

  6. #6
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Compile data from one sheet to another

    OOOOH Alan! Now we're talking =D Just posted my reply as you posted yours at the same time. You gave me a code that does it the way my thinking does. I tried copying the code into the code of the sheet (rightclick the sheet - view code) should I have it another way? How do I get this script to run when the sheet tab is selected/opened/switched to? It doesn't work when I pasted it into the sheet code ='( when I run it as a macro I only get the messagebox but no list is displayed.

    If you have the time to assist me some more it would be grately appreciated! I'm getting so thilled now that I have hope of getting this fixed soon

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,743

    Re: Compile data from one sheet to another

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

    Also, here is your file back with a command button to run the macro.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Compile data from one sheet to another

    Thank you Alan =) Sweet of you to give me a guick guide on how to insert the macro, I know this much, but it's not what I'm looking for (or I don't think I am?) I have made buttons that links to macros etc too. Now I absolutely don't want to appear ungrateful, but I would really like the macro to run automatically when I switch to the order sheet from the product sheet, don't want to have to use a button (the person this workbook is going to be used by is a real newbie who will forget to click it...) Is this possible? How do you run a macro when the sheet is opened? Can I put it in "ThisWorkBook" or the code of the sheet instead of in a module? Can I call the module some other way than using a button?

    And also, your excellent file has no summary at the bottom. Fixable? I realized it was stupid of me to have merged cells in the ordersheet (missed that when i copied info...), that can be ignored and the row can just be pasted as it is in the same comlumndesign.

    But thanx to you I'm closing in on a good solution, and for that I am happy =D

    Thumbs up for you Alan

  9. #9
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Compile data from one sheet to another

    Hmmm.. Ok, so I Googled how to run a macro when a sheet is activated, so far so good. But... I now realized that I need to have the macro delete all previous rows before adding rows again when the macro runs or i will get a messed up orderlist, and there is no way of doing nice changes to the order. What i need is for the macro to delete all rows down from row 20 until it hits an empty row.

    Grrr! How frustrating it is to know what you want done, but don't have the competense do write the code!

    Alan if you have any patience left for me, I will be a happy camper!

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,743

    Re: Compile data from one sheet to another

    Understand what you are looking for on the deletions. I have a meeting coming up but will work on later this evening. I don't think the row deletions should take long.

    Yeah, merged cells are a real nuisance when you run VBA. Since you have the VBA running when you want it to, I will not address that now.

    Alan

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,743

    Re: Compile data from one sheet to another

    Had a couple of minutes. Took less time than anticipated.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-03-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2013
    Posts
    6

    Re: Compile data from one sheet to another

    Thank you so much for all the help!


  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,743

    Re: Compile data from one sheet to another

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 16
    Last Post: 11-05-2013, 06:48 AM
  2. Vlookup to filter data from 2 sheet and compile to one sheet??
    By Superslinky in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2013, 07:21 PM
  3. Take info from a master sheet and use Macro/VBA to compile data on another sheet.
    By JPLANERA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2012, 10:47 AM
  4. Need Help: Compile Data from Multiple Sheets into New Sheet
    By amroberts2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2012, 02:55 PM
  5. Help with using a work sheet to compile data
    By lowspark in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-30-2006, 09:47 AM

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