+ Reply to Thread
Results 1 to 4 of 4

Converting Rows to Columns

  1. #1
    Registered User
    Join Date
    08-29-2011
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Converting Rows to Columns

    I have a sheet that has related data that is in one row but several other pieces of data are in a column. For example, the Customer Number, Name, and Contact are in one row, but the Contact Title, Contact Phone, and Contact Email are in separate rows beneath the Contact. I would like all data to be in one row but am not sure how to do this without copy/paste. There are a total of 6000+ rows so copy/paste is not very efficient.

    There are some records which may have 3 rows of data and others may have 4, depending if a phone or email is missing.

    How do I get the data into the format I want?

    I've included a sample of how the sheet currently looks and how I would like it to be.

    Thanks!
    Attached Files Attached Files
    Last edited by mschlenker; 08-30-2011 at 12:58 PM.

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

    Re: Converting Rows to Columns

    This macro will do it. Add a sheet to your workbook called OUTPUT and then this macro will move over the data from your SHEET1.
    Please Login or Register  to view this content.

    The logic here is that if there are 4 rows, then phone number and email are included and are in the correct order, email last.

    If only 3 rows, it will test the last letter of the 3rd row, if it's a number, it will go in the phone column, a letter will go in the email column.
    _________________
    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!)

  3. #3
    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: Converting Rows to Columns

    Hello mschlenker,

    Welcome to the Forum!

    Here is another method of convert the data into rows. The attached workbook has the macro added along with a button a "Sheet1" to run it. The results are appended to "Sheet2".
    Please Login or Register  to view this content.
    Attached Files Attached Files
    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!)

  4. #4
    Registered User
    Join Date
    08-29-2011
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Converting Rows to Columns

    Thank you Jerry and Leith! Your expertise is greatly appreciated!


+ 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