How To Enable Macros In Microsoft Excel

Microsoft Excel is full of little tricks and features that are designed to make it easier for you to set up and manage your spreadsheets. Though unlike formulas — which can be used to automatically sort, categorize, do the math for you, and even be written by ChatGPT — macros don't compile data. Well, not unless you tell them to.

Advertisement

Excel macros are more like pre-programmed actions you can set up and customize that will let you turn a multi-step process into a single action. Think of something along the lines of adding a contact in your phone, or using auto-fill when entering info on a website. Once the initial setup is done, the process will be much faster in the future.

The catch is you have to record every step you want to add to the macro first and possibly make adjustments once you're done. You'll also need to turn on Excel's Developer tab in order to access the option in the first place. But once you're finished, you'll be able to run your custom macros from the Developer tab or via shortcut keys (if you set them up).

Advertisement

Setting up the Developer tab

You won't see the Developer tab in Excel by default, though depending on whether or not you share the software with anyone else (and what they may have set up previously), there's a chance you won't have to take this step. But if you open Excel and don't see the Developer tab in the ribbon at the top of the window, follow these steps:

Advertisement
  1. In Windows: Click on File in the menu at the top of the screen and select Options from the drop-down menu.
  2. Select Customize Ribbon, then find the Main Tabs section.
  3. Click the check box next to Developer to turn on the Developer tab.
  4. In macOS: Click Excel in the menu at the top of the screen, then select Preferences from the drop-down menu.
  5. Choose Ribbon & Toolbar, then find the Main Tabs section and look for the Customize the Ribbon category.
  6. Click the check box next to Developer to turn the Developer tab on, then click Save.

Double-check the ribbon to make sure the Developer tab is showing up, and if so, you're ready to start creating (and running) your own macros. Also, be aware that the Developer tab will always be displayed in the ribbon from now on unless you either go back into Options and turn it off or re-install Excel.

Recording your macros

Once you know what macros you'd like to set up and have the Developer tab ready, here's what to do in Excel on Windows or macOS:

  1. Click the Developer tab and find the Code group.
  2. Optionally, you can add a name for your macro, set up a shortcut key combination, and add a description for your macro.
  3. Select Record Macro when you're ready.
  4. Perform the actions you want Excel to record (entering text, text editing, cell organizing, etc.).
  5. When you're finished, click Stop Recording in the Developer tab.
  6. To edit your macro, select it in the Developer tab and then choose Edit — this will pull up the Visual Basic Editor.
  7. Adjust the code as you see fit using the editor and test out the results. If you're unfamiliar with using the Visual Basic Editor, try to make small adjustments to learn what impact they have before attempting extensive editing.

With recording complete, you're free to experiment with your macros however you want. Set up more, edit the finer details of the ones you've saved, re-record them with different steps, and so on.

Advertisement

Running your macros

Now that you have a macro or two recorded, it's important to know how to run them. This can vary depending on your preference as well as how you set up your macros.

  1. Click on the Developer tab and select the macro you want to run.
  2. Choose Run to turn on the macro and wait for it to finish.
  3. Alternatively, if you set up a shortcut key combination, you can activate the macro by pressing the assigned keys.

Be careful when assigning shortcut keys as macro shortcuts will supersede other shortcuts in Excel, meaning there's the potential to replace a common function like Save or Undo if the key commands overlap. If this happens, either change the keys via the Shortcut key box in the Developer tab or delete and re-record the macro.

Advertisement

When using your macros, it's best to let them finish running before attempting to use another as the overlapping processes could produce unexpected (and undesired) results.

Recommended

Advertisement