Copying selected rows from 2 sheets on a main third sheet

  • Hello,

    I was wondering if I could get some help with the following. I have 3 sheets of data on them. All of them have a unique Key in column A. However, my sheet entitled "money file" has 12 lines (years) of data associated with each key, while the other 2 sheets just have one line of data associate with each key. I would like to get all of this information on one sheet, with 12 lines per key.

    For example, lets say that my key is 12345. This is found on all 3 sheets. On the first two sheets, there is a different key for each row. However, on the third sheet, each key appears 12 times, representing different years worth of data. For my final output, I would like my 12 lines to look like this:

    Key 1: Data from Sheet 1,key1......... Data from Sheet 2,key1.......Datafrom Sheet 3,key 1
    ..........................................................................................Datafrom Sheet 3,key 1
    ..........................................................................................Datafrom Sheet 3,key 1
    ..........................................................................................Data from Sheet 3,key 1
    ...........................................................................................Datafrom Sheet 3,key 1
    etc

    Key 2...


    Can anyone help me with this, so that I am getting like data for like keys and also in the desired format?

  • Re: Copying selected rows from 2 sheets on a main third sheet


    This is similar to another post:
    http://www.ozgrid.com/forum/showthread.php?t=152739


    and this is yet another use for the FindAll function:
    http://www.cpearson.com/excel/FindAll.aspx


    So modifying the code slightly from my previous example should give you the result you are looking for.


    I have attached a sample file with code so you can see how this works. The sample has a variable number of entries with the same key on sheet 3 but the code will also work if the number of entries on sheet 3 is constant as it is matched based on the ID value in column A.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!