+ Reply to Thread
Results 1 to 11 of 11

Worksheet has multiple columns with same header title, need to consilidate into one

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Unhappy Worksheet has multiple columns with same header title, need to consilidate into one

    Hi,

    I have a worksheet that has multiple columns sharing the same header names. I need all of those to just have one column. It is critical that the first column found that has a matching header is appended below the first column with that header, the second column found that has a matching header is appended below the second column of information that was appended to the original, etc..

    I have a sample, but am not able to attach to this message. If somebody can give me a heads up on how to do that I'll attach my "from/to" example. It is preferable to contain everything to just the one worksheet.


    Thanks in advance for any advice.

    Steve

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Just loop through all the sheets, find the required column and paste it under the previously pasted columns.

    Here's some rough code.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    I replied earlier, but didn't see my post come up. Not sure if there is supposed to be a delay or not. So I apologize if this is the second response.

    Thanks for your quick response. I see that this will loop through all the worksheets. Is there a way to contain it to only the one worksheet. I have a "From/To" .jpg file I'm attaching to better show what I'm after. Thanks again, because I have been lost on this one.


    Sample - Column Append Issue.jpg

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Oops, I misread your original post and thought you had the same header in multiple worksheets not the same header repeated in one worksheet.


    Actually, looking at the image it appears you have the same three headers repeated across the columns, is that right?

  5. #5
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Thank you Norie for looking at this. The answer is yes and actually the next time I import data it could be 4 repeated headers or 5 or even 2. It will vary. I just need to stack them up in order from left to right.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    John thank you for the response. That seems to do the trick, but it dropped off the last 6 or 7 cells under the column diameter when I ran it.

    Missing:

    0.00085
    0.00099
    0.00039
    0.00127
    0.00494
    0.00121
    0.00013

    Steve

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Try:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Wow. That is excellent work. Now I just need to study it to see if I can follow what it is actually doing. Thank you so much.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.


    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  11. #11
    Registered User
    Join Date
    10-27-2010
    Location
    Salisbury, Maryland
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Worksheet has multiple columns with same header title, need to consilidate into one

    Sorry about that. I haven't been on here for quite a while. I think I did everything. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Merge multiple worksheet to summary worksheet based on column header value match
    By rafiomeon in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-23-2012, 03:37 AM
  2. Replies: 2
    Last Post: 10-13-2012, 03:30 AM
  3. PivotTable Help - Multiple columns with same title
    By shaheedfaiz in forum Excel General
    Replies: 0
    Last Post: 07-22-2011, 12:17 PM
  4. Excel 2007 : Reference columns by name/header/title
    By awayand in forum Excel General
    Replies: 7
    Last Post: 10-26-2010, 07:06 AM
  5. Replies: 2
    Last Post: 02-02-2006, 01:45 PM

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