+ Reply to Thread
Results 1 to 8 of 8

Macro to Transpose variable columns into rows

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Macro to Transpose variable columns into rows

    Hi All,

    I have a data set, (obtained after using text to columns function) and it contains data in variable colums. I need a macro to convert these variable colums into multiple rows, but in a single column.

    I have attached the file. The sheet "original set" is the data I have and the "desried set" is the data that I need.

    Thank you!!
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to Transpose variable columns into rows

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to Transpose variable columns into rows

    To arlu's solution I would like to add mine, a slightly different approach.

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    01-07-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to Transpose variable columns into rows

    Thanks both of you...for such a quick response.
    Alf code suited me better and solved my problem!Arlu code also worked

    U guys are awesome! :D!!!
    Thanks once again

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to Transpose variable columns into rows

    Glad to be of help and thanks for feedback.

    Alf

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro to Transpose variable columns into rows

    Glad it worked for you.

  7. #7
    Registered User
    Join Date
    12-11-2012
    Location
    Johannesburg
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Macro to Transpose variable columns into rows

    Good Day

    I have a similar Question:

    i have data populated into columns,please assist me with a Macro that will now calculate all the Values in the "Data" tab and populate it on the corresponding rows in the "Report" tab. please see the Spreadsheet attached

    Thanking you in Advance
    Attached Files Attached Files

  8. #8
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to Transpose variable columns into rows

    Forum rule #2
    Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
    Alf

+ 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