How to sort rows on the Excel worksheet xlCompare

If you've got a table with mixed values, better to have them sorted to analyze comparison results. Sorting is not required - xlCompare sorts data during comparison, but visual representation of the results looks much better with sorted data.

Excel application has similar function, so we've decided to implement analogue.

Select a column on the worksheet and right click on the selected area. Right click menu contains Sort popup menu with the following commands:
  • Ascending
  • Descending

Sort rows menu command

It sorts data on the worksheet by values in the selected column.

This command works like Remove Empty Rows command. It finds header area and exclude it from sorted data. So, when you sort values in your table, header is always same.

See Also: