+ Reply to Thread
Results 1 to 5 of 5

combining columns from different worksheets

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    houston, tx, usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    combining columns from different worksheets

    Hello

    I am working on a macro but I am not sure if I am being eficient. Maybe there is a better way to do that.

    Suppose I have a workbook with 3 sheets. Each sheet has a column ID with a part number. The rest of the columns on the sheet represents attributes for those part number. rows are not ordered.

    Here is an example:

    sheet 1
    pn, color, size
    001, yellow, big
    002, red, medium

    sheet 2
    pn, code, location
    003, A, east
    001, B, west

    sheet 3
    pn, direction, width, height
    002,up,3,3
    001,down,2,5

    I want to create a new sheet that combines the parts attributes like this:

    pn, color, size, code, location, direction, width, height
    001, yellow, big, B, west, down, 2, 5
    002, red, medium,-,-,up,3,3
    003,-,-,A,east,-,-

    My approach is to do it programatically in VB. Am I going the long way? Is there a formula that can do this?

    Thanks in advanced.
    Attached Files Attached Files
    Last edited by lacalacaloca; 11-05-2012 at 01:31 PM. Reason: adding attachment

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: combining columns from different worksheets

    Would your output be in the same cell or are the commas meant to represent columns?

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    houston, tx, usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: combining columns from different worksheets

    Yes, the commas represent columns. I added a sample file on my original post.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: combining columns from different worksheets

    Copy of combiningColumns.xlsxThe attached uses an array formula - I only applied it to the first 2 columns - Enter the formula in B2 and extend the range to C2 - Commit the formula with Ctrl+Shift+Enter and pull down as needed. The other data can be obtained with a similar formula

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    houston, tx, usa
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: combining columns from different worksheets

    Thanks pepe. I'll try that. This is a good start. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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