+ Reply to Thread
Results 1 to 7 of 7

Grab data from one workbook and copy to report style workbook

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Grab data from one workbook and copy to report style workbook

    Hello Excel Gurus,

    I'm asking for one simple macro, I'm sure it doesnt take long. I"m going to explain it in a very simple form.

    I have two workbooks: Workbook #1 is list with ALOT of Raw Data, but i'm going to simplify it as so:
    First Name Second Name Social
    Joe Harris 12345
    Mark Smith 678945
    Jeff White 45698
    Camilla Johnson 45879

    Workbook number 2 is a Report style workbook. The end user will input the social security number for which data its needs. using that social number the macro would identify it on the workbook #1 and gather the data from that specific row and copy it to the workbook number 2. EXAMPLE: Let's say I need the info from social "12345", macro will find "12345",grab First Name "joe" and Last Name "Harris" and put it in cells...A3 and C5 in workbook number 2.

    Is this clear? Again, in this example its just 2 fields i'm transfering info to workbook number 2. BUT in reality its over 25 fields that are being transfered from the Raw data, onto the Report format workbook.

    Thanks!!!

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Grab data from one workbook and copy to report style workbook

    You could use INDEX and MATCH
    For example:
    B1= Lookup Criteria
    Array of Data: A3:C7
    Social Security Data: C3:C7

    =INDEX(A3:C7,MATCH(B1,C3:C7),1)

    =INDEX(A3:C7,MATCH(B1,C3:C7),1) would return first name
    =INDEX(A3:C7,MATCH(B1,C3:C7),2) would return last name

    An example is attached
    Attached Files Attached Files
    Click on star (*) below if this helps

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Grab data from one workbook and copy to report style workbook

    Thanks! But It's a bit more complicated (I believe). Attached is the Workbook #2, so the report. All the Raw Data from workbook#1 would be matched and then plotted into its corresponding cells. So, again i gave you a very simple example, on the report...it would march value by "Number" (O3), grab from Raw Data and copy it to, let's say, the "Overall" (C7) cell. With your INDEX, how would I move about different columns and cells.



    Thanks again!!
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Grab data from one workbook and copy to report style workbook

    To make the formula dynamic, instead of hard coding the columns, ie 1,2,3,4, etc., you could use the column (COL) function and copy the formula to the left

  5. #5
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Grab data from one workbook and copy to report style workbook

    Can you give me an example?

  6. #6
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Grab data from one workbook and copy to report style workbook

    Suppose we take the formula and want to make it relative so we can copy it to the right:

    Start with this:
    =INDEX($A$3:$C$7,MATCH($B$1,$C$3:$C$7),1)

    Change to this:
    =INDEX($A$3:$C$7,MATCH($B$1,$C$3:$C$7),COLUMN(A:A))

    As you copy the formula to the right Column A becomes Column B, Column C, Column D, etc.

    More Precisely
    =Column(A:A) =1
    =Column(B:B) =2
    =Column(C:C) =3
    Last edited by K m; 11-14-2012 at 10:43 AM.

  7. #7
    Registered User
    Join Date
    10-22-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Grab data from one workbook and copy to report style workbook

    Ok GREAT! it works. I'm going to populate the entire report with the formula...if I need more help I will reply again.

    Thanks!

+ 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