- On the Tools menu, point to Macro, and then click Record New Macro.
- In the Macro name box, enter a name for the macro.
Note The first character of the macro name must be a letter. Other characters can be letters, numbers, or underscore characters. Spaces are not allowed in a macro name; an underscore character works well as a word separator.
- In the Store macro in box, click the location where you want to store the macro.
-
If you want to include a description of the macro, type it in the Description box.
- Click OK.
- Record the actions you want for the macro, and then on the Stop Recording toolbar, click Stop Recording .
Create a macro using Microsoft Visual Basic
- In Microsoft PowerPoint, on the Tools menu, point to Macro, and then click Visual Basic Editor.
- In Microsoft Visual Basic Editor, on the Insert menu, click Module.
- Type or copy your code into the code window of the module.
- If you want to run the macro from the module window, press F5.
- When you're finished writing your macro, on the File menu, click Close and Return to Microsoft PowerPoint.
Copy part of a macro to create another macro
- Open the presentation that contains the macro you want to copy.
- On the Tools menu, point to Macro, and then click Macros.
- In the Macro name box, enter the name of the macro that you want to copy.
- Click Edit.
- Select the lines of the macro you want to copy. To copy the entire macro, make sure to include the Sub and End Sub lines in the selection.
- Click Copy , switch to the module where you want to place the code, and then click Paste .