+ Reply to Thread
Results 1 to 5 of 5

Combining 2 sheets of data to 1 sheet w/sorting

  1. #1
    Registered User
    Join Date
    10-26-2007
    Posts
    5

    Combining 2 sheets of data to 1 sheet w/sorting

    I have two worksheets w/multiple columns that I need taken from the 2nd sheet and moved to the 1st alongside the corresponding columns. Here's an example to make it clearer

    Sheet 1 has 3 columns

    ID Animal #
    01 dogs 27
    02 cats 12
    03 lizard 8
    04 ferrets 6

    Sheet 2 has the same three columns (note columns 1 and 2 are the same on both sheets, the 3rd column is the only one w/different values).

    ID Animal #
    01 dogs 8
    02 cats 21
    04 ferrets 5

    I need to make Sheet 1 look like this (Sheet 2 isn't as large as Sheet 1 so it should leave blanks where it doesn't correspond with Sheet 1 as the lizards row below)

    ID Animal # ID Animal #
    01 dogs 27 01 dogs 8
    02 cats 12 02 cats 21
    03 lizard 8
    04 ferrets 6 04 ferrets 5

    In my file I have thousands of columns in sheet 1 and hundreds in Sheet 2 so I can't do it manually. I originally was playing w/VLOOKUP but had no luck. Is there a formula anyone knows that can assist me, thanks.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    I'd be tempted to do this one by macro. Can you post a copy of the data as the layout will be important.
    Martin

  3. #3
    Registered User
    Join Date
    10-26-2007
    Posts
    5

    Reply to reply

    I attached a word file with the animal example.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-26-2007
    Posts
    5

    mrice suggestion

    Mrice,
    When you mentioned Macro I looked it up and played with it. I don't think it will work because when I copy and paste the data from Sheet 2 to Sheet 1 I have to look at the ID #s and paste the information from Sheet 2 where the ID #s match. From what I saw about Macros it won't look at the ID #s to match it but will just follow the pattern I did when creating the Macro. There might be a more advanced way to set up the Macro but I couldn't figure it out.

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    I guess that you are thinking of a straight recorded macro which would have many limitations.

    I would be suggesting a macro written from first principles including a looping construct and in order to do this we would need to see an example in Excel of both the multi column starting point and what the ,presumably multicolumn, end point look like.

    You can attach an Excel file by Winzipping it.

+ 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