+ Reply to Thread
Results 1 to 3 of 3

Transposing columns to rows:programmatically

  1. #1
    Registered User
    Join Date
    01-11-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    4

    Transposing columns to rows:programmatically

    I am looking to somehow programmatically transpose columns to rows, replicating each instance of the data in the first column to the related transposed rows.

    For example:

    1 a b c d
    2 e f

    Would become:

    1 a
    1 b
    1 c
    1 d
    2 e
    2 f

    The number of rows will vary, and the number of columns for each row will also vary. The first column is not always numeric and the remaining columns are not always letters.

    I am aware of how to paste special and transpose, which sort of serves the purpose manually, but was wondering whether there was a more efficient way to do this?

    An example is attached - thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    re: Transposing columns to rows:programmatically

    Try this. It puts results on sheet2.
    Please Login or Register  to view this content.

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

    re: Transposing columns to rows:programmatically

    pcdj,

    Detach/open the attached worbook "Transposing columns to rows - pcdj - SDG11.xls" with macro "ReorgData".

    The "ReorgData" macro will create a new worksheet called "Results".
    Attached Files Attached Files
    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.

+ 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