How to Use Macro in Excel
There are several ways to run a macro in Microsoft Excel. A macro is an action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language. You can always run a macro by clicking the Macros command on the Developer tab on the ribbon. Depending on how a macro is assigned to run, you might also be able to run it by pressing a combination shortcut key, by clicking a button on the Quick Access Toolbar or in a custom group on the ribbon, or by clicking on an object, graphic, or control. In addition, you can run a macro automatically whenever you open a workbook.
Before you start working on macros you should enable the Developer tab.
For Windows, go to File > Options > Customize Ribbon.
For Mac, go to Excel > Preferences... > Ribbon & Toolbar.
Then, in the Customize the Ribbon section, under Main Tabs, check the Developer check box, and press OK.