A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You can pretty much put any code that is valid in that procedure.
You can turn on the macro recorder and then manually sort your data on each sheet to get the code you need.
The code will be a record of your manual actions, so you will want to clean it up and make it consistent with the code above.
--
Regards,
Tom Ogilvy