+ Reply to Thread
Results 1 to 5 of 5

Formating Data - columns to rows

  1. #1
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Formating Data - columns to rows

    I have a large data set consisting of two columns with repeat row names but unique row values. Here is a small example:

    Please Login or Register  to view this content.
    I would like to convert this to a few rows with multiple columns. Like this:

    Please Login or Register  to view this content.
    I tried to record a macro, but I could not figure out how to get the macro to not only select the range of cells from B1:B7 but also from B8:B14 when I click on B8. The macro always reverted to B1:7.

    Here is my example macro:

    Please Login or Register  to view this content.

    Thank you for your help.
    Last edited by JBeaucaire; 12-23-2013 at 05:40 PM. Reason: Added code tags, please read and follow the Forum Rules, link in the menu bar above. Thanks.

  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: Formating Data - columns to rows

    Your example looks pretty "clean", always 7 values per column A value. Is that a good enough "method". If the need is more "dynamic", use this:


    'COLUMNS TO ROWS
    Here's a macro for merging columns of data to one row matching for column A. There's a sample workbook too you could drop your data into and test it out.
    Last edited by JBeaucaire; 12-27-2019 at 04:10 AM.
    _________________
    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
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formating Data - columns to rows

    WOW!!1 The Consolidate Macro Worked even for my large dataset!!! What an amazing resource. It did repeat the first row, however. This was easy to fix. I think this has something to do with a header being required in the data.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Formating Data - columns to rows

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Formating Data - columns to rows

    Thank you. I will mark the threads appropriately in the futuer. I have thanked my replier with the small star icon.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010- Copy Conditional Formating from a row with 4 columns to all rows
    By dudeshane01 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2013, 12:45 AM
  2. Compress columns and rewrite as rows
    By The Mathguy in forum Excel General
    Replies: 2
    Last Post: 10-19-2013, 01:25 PM
  3. [SOLVED] Duplicate rows data formating
    By santosh_vjit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2013, 10:41 AM
  4. Formating Cell Rows and Columns?
    By bnd10706 in forum Excel General
    Replies: 1
    Last Post: 10-10-2012, 01:08 PM
  5. [SOLVED] conditional formating of group of columns and rows
    By Madhav in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-08-2005, 03:06 PM

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