Macros are created to automate repetitive tasks. You can record a macro via the Developer tab or write one using the VBA editor.