Excel macros allow you to automate many of the common tasks you’ll perform, from inserting formulas to formatting data. You don’t need to be a programmer to create them, as Excel can record your actions as you perform them. If you want to know how to record a macro in Excel, you’ll need to follow the steps below.

What Is an Excel Macro?

An Excel macro is a recorded set of instructions, created manually in VBA (Visual Basic for Applications) or recorded automatically using Excel’s Macro Recorder tool. A macro allows you to save any number of common actions, such as deleting blank columns, changing text formatting, or inserting new formulae into a workbook. These saved actions can then be run with the click of a button or by using a specific keyboard shortcut. Each macro has a specific shortcut that you can use to quickly repeat the action. If you use Excel to record a macro, you’ll reduce the time it takes to create or edit a spreadsheet, speeding up your workflow in the process.

How to Record a Macro in Excel

The easiest way to create a new macro in Microsoft Excel is to record it using the Macro Recorder tool, which you can use in Excel on Windows or Mac. Unfortunately, it isn’t possible to record a macro in Excel Online. 

Running, Editing or Deleting Existing Microsoft Excel Macros

Depending on the save location you selected in the Record Macro window, your recorded Macro will be ready to run in your open workbook or in a newly opened workbook.

Saving Excel Files with Recorded Macros

Excel workbooks are typically saved in the XLSX file format (or XLS for workbooks created in Excel 2007 and older). This file type supports most Excel data, but excludes any saved Excel macros. To save an Excel file with recorded macros, you’ll need to use the XLSM file format instead.

Sharing Excel Files with Recorded Macros

Excel macros are useful, but they also include potential security risks. If you open an Excel file containing macros from a source that you don’t recognize or trust, then you’re allowing that file to run dangerous code on your PC. Because of this, online email providers like Gmail automatically block users from sending XLSM (macro-enabled Excel workbook) files to other users. If this happens, you may be able to use file sharing services like Google Drive to share it online with other users. If you want to share your macro-enabled Excel file with another user nearby, then you could also look at local file transfer methods to share it with another PC or Mac, or with other devices like smartphones. Macro-enabled Excel files can be packaged with viruses or other malware, so if you open an Excel file that you don’t trust, you may need to scan for malware afterwards to ensure that your PC isn’t compromised. Or scan the file itself before opening it.

Advanced Excel Tips and Tricks

Recording a macro is just one Excel trick that can help you save time, but there are other Excel features that can make you more productive as well. Power users might be interested in using Excel to scrape data online, while data analysts might be curious about how to use COUNTIFS, SUMIFS and AVERAGEIFS for extensive data analysis. If you prefer to work as a team, or you’re struggling with a complicated Excel formula, you can also collaborate on Excel spreadsheets using a shared workbook. You may find that Google Sheets is a better option for online collaboration, however, with many of the same functions and features.

How to Record a Macro in Excel - 54How to Record a Macro in Excel - 62How to Record a Macro in Excel - 43How to Record a Macro in Excel - 56How to Record a Macro in Excel - 91How to Record a Macro in Excel - 29How to Record a Macro in Excel - 85How to Record a Macro in Excel - 54How to Record a Macro in Excel - 82How to Record a Macro in Excel - 52How to Record a Macro in Excel - 13How to Record a Macro in Excel - 93How to Record a Macro in Excel - 17How to Record a Macro in Excel - 50