+ Reply to Thread
Results 1 to 8 of 8

Sort data 2 column ?

  1. #1
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Sort data 2 column ?

    I want to sort column Status (column C) by sort text "Accepted", "Completed", "Handling", "Scheduled", "Closed", "Rejected"
    and sort column Remark (column E) by sort have data , blank

    Please guide me about it. (VBA , Macro)

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Sort data 2 column ?

    There are instructions at the top of the page on how to post a sample sheet.Thanks

  3. #3
    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,897

    Re: Sort data 2 column ?

    Administrative note
    Please update your profile as necessary to properly reflect the exact version(s) of Excel your question relates to. Members tailor answers based on your Excel version. Your profile does not indicate your Excel version. Excel versions are indicated similar to 2013, 2016, 2019, O365 etc.
    Thanks
    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

  4. #4
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Sort data 2 column ?

    File input as attached.
    Attached Images Attached Images
    Attached Files Attached Files

  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,897

    Re: Sort data 2 column ?

    Here is a link to create a customized sort list. Once you have this list created, you can then record a macro to do the sorting for you. If you need assistance with fine tuning the recorded macro, post back in this thread.

    https://support.microsoft.com/en-us/...b-ba213ec2fd61

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Another way …


    According to the attachment as 'Rejected' does not exist so the data must be corrected or
    this beginner level Excels basics VBA demonstration :

    PHP Code: 
    Sub Demo1()
        
    With [A1].CurrentRegion.Columns
           
    .Item(.Count 1) = Application.Match(.Item(3), [{"Accepted","Completed","Handling","Scheduled","Closed","Rejected"}], 0)
           .
    Item(.Count 2).Formula "=ISBLANK(E1)"
           
    .Resize(, .Count 2).Sort .Item(.Count 1), 1, .Item(.Count 2), , 1, , , 1
           
    .Item(.Count 1).Resize(, 2).Clear
        End With
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !

  7. #7
    Forum Contributor
    Join Date
    03-08-2021
    Location
    thailand
    MS-Off Ver
    2016
    Posts
    117

    Re: Another way …

    I have a question.
    If I move column remark to column AM.

    How to edit your code?

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Sort data 2 column ?


    As you should see in my VBA procedure you just need to update the Remark first cell address within the formula …

+ 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: 12
    Last Post: 09-08-2018, 10:34 PM
  2. Replies: 1
    Last Post: 03-29-2018, 07:58 AM
  3. [SOLVED] Sort column data separated by blanks into other column
    By vivmahal in forum Excel General
    Replies: 16
    Last Post: 12-01-2016, 08:52 AM
  4. Need to Sort Column Data - Horizontal Sort Not Working
    By Jadd in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 11-01-2016, 07:09 PM
  5. Replies: 1
    Last Post: 03-04-2015, 02:57 PM
  6. [SOLVED] Sort by column E, and create sheets named by that column, add header and data
    By salaso69 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-24-2012, 12:42 AM
  7. Replies: 1
    Last Post: 03-17-2005, 08:06 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