+ Reply to Thread
Results 1 to 6 of 6

Code to convert to columns, copy and transpose data

  1. #1
    Registered User
    Join Date
    10-05-2010
    Location
    San Francisco
    MS-Off Ver
    Excel 2007
    Posts
    5

    Code to convert to columns, copy and transpose data

    Hi

    I have data in the format (two columns)

    Column A Column B
    a abc, xyz, ghi, klm


    Assuming my starting cell is top left "a" - what I'd like to do is:

    - copy the existing row into all rows below that have a blank in column A
    - move to column "B"
    - convert the comma separated cell into columns (comma is delimiter) - overwriting the current cell
    - copy all non blank cells created in the current row(including the cell in column 2 and all cells created to the right)
    - transpose and paste those cells at the current cells
    - move back to column A

    end result would look like this:
    Column A Column B
    a abc
    a xyz
    a ghi
    a klm


    Any help appreciated

    Ian

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

    Re: Code to convert to columns, copy and transpose data

    Can you post a sample workbook?

    OK, I think this works for entries in A1 and B1, but guessing you have more to do. A workbook would still be useful.
    Please Login or Register  to view this content.
    Last edited by StephenR; 10-06-2010 at 01:27 PM.

  3. #3
    Registered User
    Join Date
    10-05-2010
    Location
    San Francisco
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Code to convert to columns, copy and transpose data

    Here it is - my actual data has multiple rows - I already have the rows spaced with the correct number of gaps so that transposing the data will fit perfectly

    So I just need code to fit inside the loop that I already have that creates the appropriate number of blank rows
    Attached Files Attached Files
    Last edited by ianjw; 10-06-2010 at 01:36 PM.

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

    Re: Code to convert to columns, copy and transpose data

    Sorry, I can't see how that file relates to your example.

  5. #5
    Registered User
    Join Date
    10-05-2010
    Location
    San Francisco
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Code to convert to columns, copy and transpose data

    Sorry - correct attachment now added

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

    Re: Code to convert to columns, copy and transpose data

    If you've got blanks in the right places, try this:
    Please Login or Register  to view this content.

+ 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