Click the View tab. Then click Record Macros on the menu.
Type a name for the macro. Assign a shortcut key to use a keystroke combination. Or assign a button to run the macro.
Click the Store macros in list: select 'All Documents' to let this macro visible to all documents, or select 'Documents Based On' to set the macro to based on certain documents only, or select 'This Document': the macro is available only in this document.
Type a description. Click OK.
Execute the commands or actions. Click the Stop Recording button.