- Click View > Macros > Record Macro.
- Type a name for the macro.
- To use this macro in any new documents you make, be sure the Store macro in box says All Documents
- To run your macro when you click a button, click Button.
- Click the new macro
Shathana. S.R. Answered question July 21, 2023
Enable the Developer Tab: Go to “File” > “Options” > “Customize Ribbon” > Check “Developer” > Click “OK.”
Open VBA Editor: On the Developer tab, click “Visual Basic” or press Alt + F11
.
Create a New Macro Module: In the VBA Editor, click “Insert” > “Module” to create a new module.
Write the Macro: Type your VBA code in the module to record the actions you want the macro to perform.
Save the Macro: Close the VBA Editor, and your macro will be saved in the document automatically.
Run the Macro: To use the macro, go to the Developer tab > Click “Macros” > Select your macro > Click “Run.”
Riya Answered question July 21, 2023