+ Reply to Thread
Results 1 to 4 of 4

combine two reports accordingly

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Pitt, PA
    MS-Off Ver
    Excel 2007
    Posts
    30

    combine two reports accordingly

    So i have two reports in two sheets, the first report "main" is a list of students and some information about them (like grade level, birthday, address, etc) The second sheet is a another report with students that might exist in the first sheet, but on the second sheet they have different information about them (like username, classes, etc). I need a VBA that will take the students names from the second sheet, look to see if they exist in the main sheet"first sheet" if yes, add the information of that student from the second sheet (the whole row) to the first sheet and line it up on the same row, so its added right next to the last cell in the row in the first sheet. I was thinking about the lookup function .. would that be a good one to use here?

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: combine two reports accordingly

    You can use VLOOKUP
    This only works if there is a unique item (name, birthday?) on both sheets.
    Something like this:
    Please Login or Register  to view this content.
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: combine two reports accordingly

    Hi and welcome to the forum

    vlookup or index match will probably give you what you want, without the need for any VBA.

    If you still have a problem, i would suggest you upload a sample work book, (all sensitive data removed), showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    03-12-2013
    Location
    Pitt, PA
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: combine two reports accordingly

    Thank you everyone for your help. I have attached a file here .. So we have the main report that includes students and some info about them and we have report 1, the second sheet, that has students and other info. the two report have students in common and a unique user name, that is how we can join the two reports. the third sheet is the expected result. Note that the header is copied as well. Thank you very much again, I am looking forward to your ideas.

    PS. how do you use Vlookup to get multiple columns in this case? Thank you very much again.
    Attached Files Attached Files
    Last edited by wahbi; 03-14-2013 at 09:04 AM.

+ 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