+ Reply to Thread
Results 1 to 10 of 10

How can sort this.

  1. #1
    Registered User
    Join Date
    04-28-2014
    Location
    Palma, Spain
    MS-Off Ver
    Excel 2003
    Posts
    4

    How can sort this.

    Hi to all, i'm new in excel and i'm in trouble.

    it is posible with a macro turn this:
    a b c f d v g
    a
    b
    c
    f
    d
    c
    f
    v
    b
    g
    g
    g
    f
    f

    into this:

    a b c f d v g
    a
    b
    c
    f
    d
    c
    f
    v
    b
    g
    g
    g
    f
    f

    thanks in advance.
    Xesc

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How can sort this.

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: How can sort this.

    Maybe like this?



    Please Login or Register  to view this content.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: How can sort this.

    Hi. Regards Mick

    I beg you to try to understand his brilliant code.
    Please could you comment out the code?
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How can sort this.

    Hi,

    A simple formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    in B2 copied across and down will create the matrix.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Registered User
    Join Date
    04-28-2014
    Location
    Palma, Spain
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How can sort this.

    Hey guys, thank you very much for your answers and your speed. You are amazing. You made me gain valuable time.
    Thank you very much again.
    Have a great day
    Xesc.

  7. #7
    Registered User
    Join Date
    04-28-2014
    Location
    Palma, Spain
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How can sort this.

    Hello again, I need a little modification on the macro.
    It's possible that the macro "pass" over the cells that not match on the headers?
    I mean, if a value on the first column not exists on the headers, now the macro "stops". It's possible that in this case simply continues with the rest of the list and leave this values on his own cell?
    Thanks,
    Xesc

  8. #8
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How can sort this.

    Try this:-
    Please Login or Register  to view this content.
    Regards Mick

  9. #9
    Registered User
    Join Date
    04-28-2014
    Location
    Palma, Spain
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How can sort this.

    Hi MickG, you did it again
    Thank you so much.
    Xesc.

  10. #10
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: How can sort this.

    xesc, you're welcome

    Marreco:- Below is the code with remarks, but the truth is, the code was a bit overkill and "dafodil11's" code was much simpler and better for it !!
    Please Login or Register  to view this content.
    Regards Mick

+ 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. [SOLVED] I have a sort macro. How to add script to preselect rows to sort based on column value?
    By Jasonhouse in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-09-2014, 02:25 AM
  2. Replies: 2
    Last Post: 01-15-2014, 09:31 AM
  3. [SOLVED] Query Multiple Web Pages> Sort For Specific Criteria > Save Lists of Sort in txt files
    By Tlandress in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-15-2013, 12:09 AM
  4. Replies: 4
    Last Post: 11-20-2012, 06:00 PM
  5. [SOLVED] Pls. reply Sort Data and copy to next coulmn when sort order chang
    By shital shah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 10:05 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