Out of Sorts in Excel
Without family, where would Excel blog ideas come from? My daughter called today, and asked how to sort more than 3 columns in Excel. She uses Excel 2003, and the Sort dialog box only allows three column choices. There’s no box to choose the fourth column – Name.
Obviously, she didn’t check my website, where she would have found the instructions to sort by four columns in Excel. You can sort in groups of 3, working up from the least important to the most important. So, I told her to sort the fourth column (Name), then the first three (Service, City, Rating).
Sorting in Excel 2007
If you like to sort lots of columns, you’ll be happier in Excel 2007. There, you can sort up to 64 columns at one time. If my daughter had Excel 2007, she could choose all four columns, and sort them in one step. In the Sort dialog box, click the Add Level button, to include another column in the sort specifications.
Automating the Sort
If you turn on the macro recorder while sorting in Excel 2007, you can create a macro to sort the table. Then, run that macro later, when you need to sort the table again.
However, if you’re sending the workbook to someone who uses Excel 2003, they’ll get an error message if they try to run your sort code.
Just like families, sometimes the different generations don’t communicate too well. ;-) Because the sort feature changed so much in Excel 2007, the older versions don’t recognize some of the new properties.
If you plan to use the workbook in both versions of Excel, record the sort macro in Excel 2003. This will also run without problems in Excel 2007. Here’s the code from this example, with the Name in column D being sorted first.