+ Reply to Thread
Results 1 to 8 of 8

Turning rows into columns (transpose won't work)

  1. #1
    Registered User
    Join Date
    07-08-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2003
    Posts
    3

    Turning rows into columns (transpose won't work)

    I have an issue that I'm having a hard time solving because it's kind of hard to describe:

    I have some data arranged:

    a11 a12 a13
    a21 a22 a23
    a31 a32 a33
    a41 a42 a43

    and I need to arrange it into a column vector of:
    a11
    a21
    a31
    a41
    a12
    a22
    a32
    a42
    a13
    a23
    a43

    for several thousand numbers. Is there anyway I can speed up this process? When I try to find help online I keep getting directed to the transpose command.

    Many thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,753

    Re: Turning rows into columns (transpose won't work)

    You don't really need transpose. Just select the data in column B, cut it and paste it at the bottom of the data in column A. Repeat the process for column C.

    Sort column A, if you wish.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Turning rows into columns (transpose won't work)

    Or if there are too many columns try this:

    Please Login or Register  to view this content.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    07-08-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Turning rows into columns (transpose won't work)

    I get an error message that the Sheets("Sheet2").Range("A1").Offset(k - 1, 0) = Sheets("Sheet1").Range("A1").Offset(j - 1, i - 1) line has subscripts out of bounds. Any ideas on what might be causing this or how I might solve this problem?

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Turning rows into columns (transpose won't work)

    If you run the code from the active sheet, the output is in new sheet.
    Attached Files Attached Files

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Turning rows into columns (transpose won't work)

    Hello raej,

    Welcome to the Forum!

    If your columns are already formatted then it is much faster to transfer the cells' values into an array, manipulate the array, and save the array back to the worksheet.

    This macro expects the data to be in a table format. It satrts a cell "A1" of the active sheet. You can change "A1" to the starting cell of your table.
    The transposed data will be in the first column. All other columns will remain untouched.

    Please Login or Register  to view this content.
    Last edited by Leith Ross; 07-09-2013 at 01:59 PM.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  7. #7
    Registered User
    Join Date
    07-08-2013
    Location
    Seattle
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Turning rows into columns (transpose won't work)

    Awesome! This saved me TONS of time. I'm very appreciative for your help!

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Turning rows into columns (transpose won't work)

    Hello raej,

    Whom are you thanking? There were four people who responded to your question.

+ 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