A macro is a recording of each command and action you perform to complete a task. Then, whenever you need to carry out that task in a spreadsheet, you just run the macro instead.
Complex macros are usually created in Excel with the Macro editor. Simpler macros can, however, be created using the Excel macro recorder.
To find out how to create a macro using the macro recorder in Excel, read the step by step Excel Macro Tutorial.