+ Reply to Thread
Results 1 to 7 of 7

Sort certain rows with macro

  1. #1
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342

    Sort certain rows with macro

    Hi All,
    I humbly seek help & advice to sort selected rows with the help of macro. Thanks a lot

  2. #2
    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
    Hello Sean,

    I think you'll need to give us just a tad more information. Which rows have you in mind, what sort criteria do you want and which fields are involved, i.e. just a primary sort or secondary and tertiary sort.

    Better still upload your workbook here along with a few descriptive notes so we can better advise. It's always easier to help when we can see the requirement in its context.

    Rgds

  3. #3
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342
    Hi Richard,
    I apologize for the lack of information. Primary sort is "Name" and secondary is "Status". I have 2 groups:- male and female, rows will be added from time to time. For instance, 1st group, I have total of 6 rows, sometimes I will only want to sort selected rows from 4 to 7. So I need a macro to do the job. I hope I have cleared the confussion. Please refer to my attached file for better understanding. Thanks in advance
    Attached Files Attached Files

  4. #4
    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
    Hi Sean,

    The attached starter for 10 may give you some ideas. I wasn't sure how fixed were the rows you want to sort, so I've left it completely open at the moment. It will sort whatever rows you enter as the start and end row. You might want to improve the functionality by prompting the user to enter the start/end rows via a pop up box. With this sort of stuff the world's your lobster as they don't quite say!

    Rgds
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342
    Hi Richard,
    You are absolutely on the right track. This is what I am looking for. If possible, I do not want to enter the "start & end" row. I want to use the mouse to select on the rows and drag. After rows are selected, click the macro button to do the sorting. Hope you can advise again, really appreciate a lot.

  6. #6
    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
    Hi Sean,

    Try the revised attachment.

    Rgds
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    01-02-2004
    Location
    malaysia
    Posts
    342
    Hi Richard,
    It works perfectly. I will try to add in 3rd sort criteria by myself. Thanks for all the time and really thankful for your help.

+ 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