+ Reply to Thread
Results 1 to 13 of 13

Auto sort alphabetically

  1. #1
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Auto sort alphabetically

    Is there a way to auto sort alphabetically in excel? For example, if I have a list to which I have to keep adding items on a daily basis, is there a command which can help auto sort the new entries everytime I enter them.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Auto sort alphabetically

    You will need VBA to do this.

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

    Re: Auto sort alphabetically

    Put this code in the worksheet change event for the sheet in question. This also assumes that the data to be sorted is in Column A. You may need to change up the range to meet your particular needs. Since you did not attach a sample worksheet, this is the best I can do under the circumstances.
    Please Login or Register  to view this content.
    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
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto sort alphabetically

    I am sorry but I did not understand where I have to enter this code. Attached is the worksheet, under sheet Item List, I need to make sure data is automatically sorted.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Auto sort alphabetically

    Please Login or Register  to view this content.
    Right click on "Item List" tab ==>View Code++> copy/paste code (Done in Attached)

    Now enter data in column B
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto sort alphabetically

    I wanted to sort data from column A, row 2. Also I tried adjusting the code, but it did not work. After entering the data, do I need to give a command for it to work?

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Auto sort alphabetically

    You want to sort by CODE not Description ?

  8. #8
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35
    Quote Originally Posted by JohnTopley View Post
    You want to sort by CODE not Description ?
    Yes by code

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Auto sort alphabetically

    Try

    Please Login or Register  to view this content.

  10. #10
    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,884

    Re: Auto sort alphabetically

    Amended John's first Code. Open your file, click on Alt +F11. In the properties window on the left, double click on Sheet3. Insert the code. It will automatically sort when you put in data in column A.

    Please Login or Register  to view this content.
    Edit: John, I believe the target column should be 1 and not 2.

  11. #11
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto sort alphabetically

    Still not working, not sure where I am going wrong. Please see attached under 'Item List' sheet
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: Auto sort alphabetically

    No code: did you follow Alan's instructions ??

    Code added (again) to attached.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: Auto sort alphabetically

    I did add the code...not sure what happened. It works now though. Thank you very much!

+ 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] VBA or normal formula to Auto-sort alphabetically.
    By Anarchus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2016, 06:53 PM
  2. [SOLVED] Auto sort alphabetically 5 Separatet tables according to name collum
    By fleyd in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-04-2015, 04:51 PM
  3. Alphabetically auto sort columns
    By higguns in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-22-2013, 12:16 PM
  4. Auto sort alphabetically using basic macro
    By Tyler1226 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2012, 04:18 PM
  5. Auto Sort Alphabetically
    By gadjit in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-01-2012, 06:30 PM
  6. Auto Sort Alphabetically
    By jollygoodfellow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-18-2008, 10:37 AM
  7. sort alphabetically and numerically, then sort rows
    By luke20allen in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-01-2008, 07:00 AM

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