In order to use a Macro, first you have to record the steps that you want done. First inside Microsoft Excel select tools, and then click on Macros, then select "Record New Macro". You will need to choose a name for the Macro in case you ever need to alter it or remember what it does in the future. Next you will select a shortcut, which is basically what you will press in order to run the Macro. For instance, if each morning you get a sales report that is the same, you could have the shortcut be the Ctrl key plus "s". Essentially your Macro can now automatically format your sales report in to a customized table, re-size you columns for you, and automatically sort the report as you choose.
To finish up the Macro, after you have named it and picked out a shortcut, select ok and now Excel is recording the actions you take. Therefore if you wanted to have a function as mentioned above that will take data and auto format it, simply pull your data into your spreadsheet and go through your steps as you normally would. Once completed, stop the recording of the Macro. The next step is to delete all of you data to leave yourself with a blank spreadsheet and save this workbook as a Macro Enabled Workbook.
From now on, every time you get this sales report open your saved Macro Enabled Workbook, drag in your data and simply hit ctrl + "s", and now your data automatically is formatted exactly how you want.