Take the 2-minute tour ×

On an Excel 2007 worksheet, I have several tables, each sharing the same columns. For every table, I sort in several particular ways, depending on the task at hand. It gets tedious going to the Data tab, clicking Sort, unchecking the "my data has headers" checkbox, then add/removing the columns and ordering sort criteria.

Is it possible to: * Save a given sort criteria (a named sort)? * Apply the sort against any selected range? * Create a button to execute each saved sort?

In the end, I would create 4 or 5 named sorts and a button for each on the worksheet. Then would be able to select any range of rows, from any table, and click one of the sort buttons. The sort would execute.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You basically nailed the concepts. Behind each button it would run some VBA code that causes the sort to occur on the data table in the way you want it.

Sample code here: http://www.mrexcel.com/forum/showthread.php?t=82770

share|improve this answer
Thanks for the link. I'll post code when/if I get it all working. –  Robert Kerr Apr 9 '10 at 19:16
add comment

Your Answer


