+ Reply to Thread
Results 1 to 9 of 9

Columns into rows and rows into columns

  1. #1
    Registered User
    Join Date
    11-12-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2007
    Posts
    59

    Columns into rows and rows into columns

    Dear all,


    I have rows (countries) and columns (months) and I would like to move the data arranged by columns in rows (countries). I wish it was as easy as using the transpose feature, but it is not. Have a look at the attachement!

    Every country should include months of the year and its data according to the columns. Values of column B should be sorted into columns.

    How would you do this? I am going nuts!

    Thanks a lot!
    Attached Files Attached Files
    Last edited by siroco79; 12-09-2013 at 06:38 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Columns into rows and rows into columns

    Hi..
    Can you attach a Workbook that shows your desired results (just the first few rows will do)..

  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Columns into rows and rows into columns

    Could you preferably select another separator, as "," are also used wthin some of the numbers?

    Update: not needed if you use the in-built function TextToColumns
    Last edited by berlan; 12-09-2013 at 09:23 AM. Reason: update

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Columns into rows and rows into columns

    I am not sure I totally understand, but I gave it a try.

    If the data is stored in a sheet named "Example", try this:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-12-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Columns into rows and rows into columns

    Hi Berlan and Apo,

    Thanks for the support. I have been working on this since my first post and have identified a number of problems that would derive from the first concept (what explained on the initial post.)
    So, I have found a solution that would work for me and have created a macro to make it work. However, I have realised that macros keeps range of cells when copying and pasting and consequently this would not work in future worksheets with different number of rows per country. Any idea on how to achieve the desired output???

    I am pasting here the macro code I used and the worksheet with 2 tabs, orginal and desired (the way I would like it to look). Note that I have used JN, FB and so on to prevent autofill to make the list of months.

    This code should give you an idea of what I am trying to achieve. If I were you I would definitely first check the original tab and after that the desired one, rather trying to understand the macro below as first approach.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by siroco79; 12-11-2013 at 06:19 AM.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,560

    Re: Columns into rows and rows into columns

    Try
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-12-2013
    Location
    Geneva
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Columns into rows and rows into columns

    Works like a charm!!! Great solution!! Thanks a lot! I should definitely start studying VBA, it makes things real and achievable! Thanks Jindon!

    How do I set this thread as Solved?

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,560

    Re: Columns into rows and rows into columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Columns into rows and rows into columns

    I feel one can always learn a great deal from @jindon. Excellent work!!

+ 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. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  2. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  3. Replies: 15
    Last Post: 12-06-2012, 01:07 PM
  4. [SOLVED] Swapping rows for columns and columns for rows in a large database
    By Bloomingdales in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2012, 06:06 PM
  5. Replies: 0
    Last Post: 11-28-2007, 06:46 AM

Tags for this Thread

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