+ Reply to Thread
Results 1 to 7 of 7

Transpose multiple text-based columns to single column while retaining record ids

  1. #1
    Registered User
    Join Date
    04-06-2010
    Location
    Vermont
    MS-Off Ver
    Excel 2003, 2007
    Posts
    3

    Question Transpose multiple text-based columns to single column while retaining record ids

    Hello,

    I am new to this service. I am hoping someone can help me with an issue I have been struggling with.

    Attached is a sample dataset. Columns D through AG need to be arranged as individual records, but columns A through C need to follow each record as each row (as currently organized) is an event. I have tried all kinds of functions (transpose, index, match, offset, etc.), but this appears to be over my head.

    Can someone help, please?

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Transpose multiple text-based columns to single column while retaining record ids

    SchoobsVT,

    Welcome to the Excel Forum.

    Can you add to your workbook a new worksheet with the new format you are looking for (say, for at least two records)?

    Click on the New Post button, then scroll down and see Manage Attachments.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Transpose multiple text-based columns to single column while retaining record ids

    run the macro and it will reformat and place the data on sheet2
    Attached Files Attached Files


    click on the * Add Reputation if this was useful or entertaining.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Transpose multiple text-based columns to single column while retaining record ids

    This should do it, it's not fast, but it does the work:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    04-06-2010
    Location
    Vermont
    MS-Off Ver
    Excel 2003, 2007
    Posts
    3

    Re: Transpose multiple text-based columns to single column while retaining record ids

    tony h, you are a life saver! That bit of VBA is magical!

    Quick follow-up question: Other than Excel's column and row limits, does this macro have any limits? For example, if I have 1000 rows (instead of just over 500) and 40 columns (instead of just over 30), will it still work, or do those parameters have to be set? Please excuse my lack of familiarity with VBA.

  6. #6
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187

    Re: Transpose multiple text-based columns to single column while retaining record ids

    It works on the size of the used area of sheet1. So it readjusts to what you have got.

    The only issue might be if your rows x columns was greater than the maximum size of a sheet.


    PS the best way to say thanks is to click on the "scales" icon (next to the red triangle) on any post you find helpful.

  7. #7
    Registered User
    Join Date
    12-10-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Transpose multiple text-based columns to single column while retaining record ids

    i think its better to store the data in a variable, do the work and paste back onto sheet or you will be slowed down by Excel/ VBA interaction. If you have huge amounts of rows and columns its worth keeping this in mind.

    See attached using this technique.
    Attached Files Attached Files

+ 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