+ Reply to Thread
Results 1 to 8 of 8

Transpose data

  1. #1
    Registered User
    Join Date
    06-13-2016
    Location
    Turkey
    MS-Off Ver
    16
    Posts
    30

    Transpose data

    Hi all,
    I have lots of data in excel include students code and their class codes, but they was typed vertically and I need to change them in form of horizontal.Because of more data. it's hard to do that manually. can someone give me a vba code to do that like the sample file?
    Thanks in advanced.
    Attached Files Attached Files
    Last edited by amir0914; 10-05-2020 at 06:12 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Transpose data

    Solution using Power Query which is found on the Data Tab and may be called Get and Transform

    Please Login or Register  to view this content.
    Review PQ
    In the attached file
    Click on any cell in the new table
    On the Data Tab, click on Queries & Connections
    In the right window, double click to open Query
    Review PQ steps

    M-code basics:
    - "let" is the start of a query
    - "in" is the closing of a query
    - each transformation step sits in between those 2 lines
    - each step line is ended by a comma, except the last one
    - "Source" is always the first step (Source Data)
    - After "in" you have the last step referenced
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    06-13-2016
    Location
    Turkey
    MS-Off Ver
    16
    Posts
    30

    Re: Transpose data

    Hi, Thanks for replying, I don't have power query and I have never used it.

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

    Re: Transpose data

    VBA
    Please Login or Register  to view this content.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Transpose data

    You have indicated in your profile a 16 which I interpreted as Excel 2016. If this is the case then Power Query is on the Data Tab of the Ribbon and is called Get and Transform. It is an integral part of Excel. To learn more about it, click on the links in my signature. It makes what you are looking to do very easy.

  6. #6
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Transpose data

    Without TextToColumns.

    Please Login or Register  to view this content.
    Kind regards, Harry.

  7. #7
    Registered User
    Join Date
    06-13-2016
    Location
    Turkey
    MS-Off Ver
    16
    Posts
    30

    Re: Transpose data

    Thank you very much, that's great.

  8. #8
    Registered User
    Join Date
    09-28-2020
    Location
    singapore
    MS-Off Ver
    2008
    Posts
    64

    Re: Transpose data

    Hi HSV

    How to add the column C to the behind column B Text as per Photo.
    Attachment 698752

+ 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. Replies: 4
    Last Post: 03-30-2020, 10:08 AM
  2. Replies: 3
    Last Post: 09-10-2019, 10:55 AM
  3. Replies: 4
    Last Post: 08-21-2018, 09:24 AM
  4. transpose column to a range calculate and transpose to new table loop
    By moshro1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-02-2015, 10:52 AM
  5. Replies: 7
    Last Post: 10-03-2014, 05:04 AM
  6. [SOLVED] Transpose: How can I copy a list and transpose it but leaving 3 cells in between each item
    By cocolete in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-11-2012, 10:01 AM
  7. Replies: 2
    Last Post: 02-19-2007, 04:53 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