+ Reply to Thread
Results 1 to 10 of 10

re-arrange column and rows?

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    19

    Unhappy re-arrange column and rows?

    I have a workbook which has two column like that:

    A..............B
    Chiris........10
    Chiris........20
    Chiris........40
    Chiris .......50
    Chiris .......30
    Lui............10
    Lui............30
    Lui............40
    Lui............80

    I want to re-arrange this data in a new sheet (not an existing one) like that in two column:

    A...........B
    Chiris ....10, 20, 40, 50, 30
    Lui.........10, 30, 40, 80

    Data has more than 10.000 rows and many different names. Is there any way to make this with a macro ?
    Thanks..

  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: re-arrange column and 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
    Last edited by arlu1201; 12-06-2012 at 03:07 PM.
    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
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: re-arrange column and rows?

    See attached
    Attached Files Attached Files
    Last edited by AB33; 12-06-2012 at 01:42 PM.

  4. #4
    Registered User
    Join Date
    12-06-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: re-arrange column and rows?

    Thanks arlu1201 your code is worked fine, but there must be a sheet called "sheet2" in workbook in order to run this macro. is there any way to see results in a new created sheet?

    And AB33; i think this code is what i need but it did not worked

    screen.jpg

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

    Re: re-arrange column and rows?

    I have edited the code.

  6. #6
    Registered User
    Join Date
    12-06-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: re-arrange column and rows?

    Thanks arlu1201 it worked.. this is fantastic.. )
    Last edited by qokalp; 12-06-2012 at 03:30 PM.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: re-arrange column and rows?

    You need to install Ms run time script in your module.
    Go to Module- tools-Refrence- Go down to the middle of the list and choose(Tick) Ms run time script. Do no run- first time, just save and close it.
    When you re-open and try to step over and see if you get this error. If you get the error, that can only be you have not installed it properly. Try it again. The code works as you can see from the result. Let me know.

  8. #8
    Registered User
    Join Date
    12-06-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: re-arrange column and rows?

    Thanks for your replay, but i can't find "Ms runtime script" on the list. maybe, my excel does not support or is there any other name. I'm using Ms Excel for Mac 2011..

    screen2.jpg

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: re-arrange column and rows?

    Hmm!
    Okay. I now know the problem. Your version of excel does not show that you have Mac. With out going deep in the teki side of VBA. There are two types of script. Early and late binding. I will try to adjust the code (tom) if it works on late binding(There is not gurantee) and see how it goes. So back tomorrow.

  10. #10
    Registered User
    Join Date
    12-06-2012
    Location
    englang
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: re-arrange column and rows?

    i see thanks for your help..

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: re-arrange column and rows?

    Please attached. I have added two more codes and finger crossed, one of them may appeal to Mac
    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