How To Create A Macro In Excel 365
Record a Macro in Excel – Instructions and Video Lesson
Record a Macro in Excel: Overview
You can easily record a macro in Excel. Macros are small programs that record your actions as you perform a task in Excel. The actions are then saved as a Visual Basic Module, which is a type of program. When you run the macro later, it repeats your keystrokes and thus repeats your actions. This is why macros are great for automating repetitive tasks.
For example, assume you wanted to place your name and your company's information in the upper-left cell of a worksheet. You could record a macro in Excel to save your keystrokes as you create it once and then run the macro in the future to repeat the exact same keystrokes you entered. This lets you instantaneously repeat the same process again.
While you can see advanced options for creating macros on the "Developer" tab in the Ribbon if it is enabled, you can also use the "Macros" button group on the "View" tab in the Ribbon to record a macro in Excel and playback basic macros. In this lesson, we will examine how to record a macro in Excel using the commands found within this button group in the Ribbon.
To record a macro in Excel, click the "View" tab in the Ribbon. Then click the "Macros" drop-down button in the "Macros" button group. From the drop-down menu that appears, select the "Record Macro…" command to open the "Record Macro" dialog box. In the "Record Macro" dialog box, enter a name for the new macro into the "Macro name" text box. Macro names cannot contain spaces. Its first character must also be a letter.
Record a Macro in Excel – Instructions and Video Lesson: A picture of the "Record Macro" dialog box in Excel.
Next, select the name of the workbook to which to attach the macro by selecting its name from the "Store macro in:" drop-down. If you do not change it, it defaults to saving the macro into the current workbook. This is important because a macro can only be run if it is attached to an open workbook or stored in the "Personal Macro Workbook," which is a hidden workbook that opens by default in Excel.
To create a custom keyboard shortcut for the macro to use in conjunction with the "Ctrl" key, type the desired shortcut key letter into the text box next to the "Ctrl +" label. If you do this, ensure you don't overwrite an existing shortcut! For example, the shortcut character of "p" is a bad choice because "Ctrl + P" is already a keyboard shortcut for the "Print" command. If you aren't familiar with the keyboard shortcuts, it may be better if you don't assign one. To start recording your macro's actions, click "OK."
Record a Macro in Excel – Instructions and Video Lesson: A picture of a user changing the cell references recorded within a macro in Excel by using the "Use Relative References" toggle command.
You can adjust the types of cell references you make when you record a macro in Excel. For example, assume that when you began recording your macro, your "active cell" was cell A1. From there, you clicked into cell D1. When Excel records you doing that, it can either record that action as a relative reference or an absolute reference. That action, if recorded using relative references, would make the "active cell" move four cells to the right of whatever cell it was in when you started to play the macro. If you recorded it in absolute terms, it would always move to cell D1 from wherever cell you had selected as the "active cell" when you started to play the macro.
To enable relative cell referencing when recording a macro, click the "Macros" drop-down button in the "Macros" button group. Then select the "Use Relative References" command to turn it on. By default, Excel macros use absolute cell references. To switch back to absolute cell referencing when recording a macro, click the "Macros" drop-down button in the "Macros" group. Then select the "Use Relative References" command again to turn it off.
After you record a macro in Excel, click the "View" tab in the Ribbon. Then click the "Macros" drop-down button in the "Macros" button group. Then select the "Stop Recording" command to stop recording the macro. Also, remember that if you want to save a workbook that contains macros in Excel, you need to select the "Excel Macro-Enabled Workbook" choice from the "File type:" drop-down in the "Save As" dialog box.
Record a Macro in Excel: Instructions
- To record a macro in Excel, click the "View" tab in the Ribbon.
- Then click the "Macros" drop-down button in the "Macros" button group.
- Then select the "Record Macro…" command to open the "Record Macro" dialog box.
- In the "Record Macro" dialog box, enter a name for your new macro into the "Macro name" text box.
- To create a custom keyboard shortcut to use in conjunction with the "Ctrl" key, type the desired shortcut key letter into the text box next to the "Ctrl +" label. If you decide to do this, make sure you don't overwrite an existing shortcut!
- Select the name of the workbook to which to attach the macro from the "Store macro in:" drop-down.
- To record your macro's actions, click the "OK" button and then perform the actions to record.
- To use relative cell referencing when recording a macro, click the "Macros" drop-down button in the "Macros" group.
- Then select the "Use Relative References" command.
- To switch back to absolute cell referencing when recording a macro, click the "Macros" drop-down button in the "Macros" group.
- Then select the "Use Relative References" command again to turn it off.
- To stop recording the macro, click the "View" tab in the Ribbon.
- Then click the "Macros" drop-down button in the "Macros" button group.
- Then select the "Stop Recording" command.
Record a Macro in Excel: Video Lesson
The following video lesson, titled "Recording Macros," shows how to record a macro in Excel. This video lesson is from our complete Excel tutorial, titled "Mastering Excel Made Easy v.2019 and 365."
Tagged under: course, excel, excel 2013, Excel 2016, Excel 2019, Excel for Office 365, help, how-to, instructions, learn, lesson, macro, macros, Microsoft Office 2019, Microsoft Office 365, Office 2019, office 365, overview, record, Record a Macro in Excel, recording macros, self study, teach, training, tutorial, video, workbook, workbooks
How To Create A Macro In Excel 365
Source: https://www.teachucomp.com/record-a-macro-in-excel-instructions/
Posted by: williamsherat1979.blogspot.com
0 Response to "How To Create A Macro In Excel 365"
Post a Comment