Excel Vba Sort Selection Alphabetically. Start with clearing the existing sort keys, then defining new keys to sort Excel will sort the cells based on the selection you have chosen from the above steps and will display the results in place. The following VBA code will read a single-column range selection from the user and reorder the cell values in.
If Excel still screws up the sort, select the header row and use the top ribbon menu to click Home → Editing → Sort & Filter → Custom Sort → My data.
Here's a guide to a basic but extremely useful function, sorting your data alphabetically.
The event macro below sorts an Excel defined Table automatically (column A) when all cells on the same row contain a value. This would help in sorting multiple columns of data in your Excel range. Here is the Example VBA syntax and Example VBA Macro code to sort the Excel Data.








