+ Reply to Thread
Results 1 to 13 of 13

Convert Rows to Columns?

  1. #1
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Question Convert Rows to Columns?

    Hello,

    Attached is an example of data that needs to summarized, where the times (12AM-11:30PM) need to be in the row section on the Left and the days of the week need be be in the columns at the top. Anyway can automatically be done?



    Attachment 235949PivotExample1.xlsx
    Last edited by brianjluke; 05-16-2013 at 09:54 AM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Novice user needs Help!

    First I ran the macro Sub CONVERTROWSTOCOL()

    After that I made an pivot table.

    See the attached file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Novice user needs Help!

    This looks great, but how do I get this macro into my working spreadsheet?

    Thanks.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Novice user needs Help!

    Alt + F11

    On the left side of the VBA editor your will find module 1.

    If you click on module 1 you find the code on the right side of your window.

    You can copy this code and paste it in your workbook.

    For that you open VBA editor:

    Alt + F11

    Inserts module

    Then you can paste the code (which you copied) in the window of this module.

    After that you can run the macro in your new workbook.

  5. #5
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Novice user needs Help!

    Do I need sheets with certain names?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Novice user needs Help!

    Please Login or Register  to view this content.
    The sheet you need to change is marked with red tekst.

  7. #7
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Novice user needs Help!

    Thanks, do I need to have an existing sheet of 'output' before running or does the macro create the sheet?

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Novice user needs Help!

    Please Login or Register  to view this content.
    already in the above code.

    this line will add an new worksheet with the name output.

    if you don't want to add an new workbook (if it already exist), you have to put an ' for the line.

  9. #9
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Novice user needs Help!

    Is there anyway to add code at the end to format the Time column to '1:30:55 PM' format?

    Thanks for the help!

  10. #10
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Convert Rows to Columns?

    Hi,

    How do I modify this macro to add additional columns to convert? Right now I just need to add 1 more column, but may need to add more in the future. thank you! The 'New' Column would be used to filter the pivot table. Thank you. PivotExample1 brianjluke.xlsm

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Convert Rows to Columns?

    See if this is what you want.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-15-2013
    Location
    Omaha, Nebraska
    MS-Off Ver
    2007
    Posts
    23

    Re: Convert Rows to Columns?

    It works, however I need for Column A, with the header 'new' in the rawdata sheet to be included in the output, can this be done? Thanks.

  13. #13
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Convert Rows to Columns?

    Maybe like this?
    Attached Files Attached Files

+ 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