

When you completed all the actions you want to include in the macro, on the View tab, click the arrow below the Macros option and select Stop Recording.You can type text, format the text, create a table, add shapes or pictures, and other actions. Perform the actions you want to record and have the macro execute. Recording of the macro begins immediately after clicking the Close button.Click the Assign button in the lower-left corner, then click the Close button.

For example, you could press the keys Ctrl+ Shift+ M, and that key combination will be entered into the field automatically.
HOW TO WRITE A MACRO IN EXCEL 365 CODE
The Microsoft Visual Basic for Applications program opens, where you can create the macro by typing the Visual Basic code manually.In the Macros window, type a name for the new macro in the Macro name text field.In Microsoft Word, click the View tab in the menu bar.To create a macro in Microsoft Word, choose how you want to create it, either manually or by recording actions, and follow the steps provided.
