Excel tot Microsoft 365 Excel for Microsoft 365 for Mac Excel 2021 also Mac Excel 2019 Excel 2019 also Mac Excel-2016 Excel 2013More or less
If you have tasks in Microsoft Excel that you perform repeatedly, you can record a macro to automate these tasks. A macro is an action or series of actions that you can perform as many times as you want. When you create a macro, you record your mouse clicks and keystrokes. After you create a macro, you can edit it and make minor changes to the way it works.
Suppose you prepare a monthly report for your accounting manager. You'll want to color the names of customers with past due accounts in red and also make them bold. You can create and then run a macro that quickly applies these formatting changes to the cells you select.
WindowsMac
How?
| Before recording a macro Macros and VBA tools can be found atDevelopertab, which is hidden by default, so the first step is to enable it. For more information, seeShow the Developer tab. ![]() |
| Record a macro
|
| Take a closer look at the macro You can learn about the Visual Basic programming language by editing a macro. To edit a macro, iCodegroup onDevelopertab, clickMacro's, select the macro name and clickEditing. Dette starter Visual Basic Editor. See how the actions you recorded appear as code. Some of the code will probably be obvious to you, and some of it may be a bit mysterious. Experiment with the code, close the Visual Basic Editor, and run your macro again. See if something different happens this time! |
Next step
-
For more information, see creating macrosCreate or delete a macro.
-
For more information about running a macro, seeRun a macro.
How?
| Before recording a macro be sure thatDevelopertab is visible on the ribbon. By default yesDevelopertab is not visible, do the following:
|
| Record a macro
|
| Take a closer look at the macro You can learn about the Visual Basic programming language by editing a macro. To edit a macro, iDevelopertab, clickMacro's, select the macro name and clickEditing. Dette starter Visual Basic Editor. See how the actions you recorded appear as code. Some of the code will probably be obvious to you, and some of it may be a bit mysterious. Experiment with the code, close the Visual Basic Editor, and run your macro again. See if something different happens this time! |
Do you need more help?
You can always ask an expert for helpExcel Tech Communityor receive supportCommunities.
Do you need more help?
Do you want more options?
Experience the community
Discover subscription benefits, browse courses, learn how to secure your device, and more.
Communities let you ask and answer questions, provide feedback, and listen to knowledgeable experts.