Home  >  Article  >  How to Create a Macro in Powerpoint Step by Step

How to Create a Macro in Powerpoint Step by Step

WBOY
WBOYforward
2023-05-13 14:13:112228browse

A macro is simply a set of instructions written by the user and saved under the macro name. When a macro name is called in a presentation, it automatically executes the set of instructions defined under the macro name. Macros are embedded into PowerPoint presentations when needed. You can use VBA to code macros in PowerPoint. It helps us create our own designs and reuse them. Macros can also be created in other Microsoft Office applications. Let’s see how to create a simple macro in PowerPoint

Steps Involved in Macro Creation

Step 1. Open PowerPoint. Type PowerPoint in the search space in the lower left corner. You can open PowerPoint with just one click.

如何在 Powerpoint 中逐步创建宏

Step 2. Double-click PowerPoint. After opening click on File

如何在 Powerpoint 中逐步创建宏

Step 3: Search for Options and click on it

如何在 Powerpoint 中逐步创建宏

Step 4: Click Customize Ribbon. On the right side of the window, customize the ribbon bar and drag down to select Developer. Press OK to complete the process.

如何在 Powerpoint 中逐步创建宏

Step 5: Now you can see the Developer tab next to the View tab. Click on the Developer tab and go to Macro Security

如何在 Powerpoint 中逐步创建宏

Step 6: Once you click on Macro Security, a trust will open center screen. Locate the Macro

settings where you need to enable all macros and check the box for Trust access to the VBA Project Object Model in Developer Macro Settings .

Once all of this is done. Click "

OK" to continue with the next process.

如何在 Powerpoint 中逐步创建宏

Step 7: After the initial setup process,

macros can be created in the project window by clicking Macro.

如何在 Powerpoint 中逐步创建宏

Step 8: A pop-up screen will appear where you can create the macro. Type

Macro Name as needed and click Create. The macro name here is HI in Presentation1.

如何在 Powerpoint 中逐步创建宏

Step 9: A Microsoft VB application window will open in which you should write a set of instructions that will be used when the macro is called from the presentation Executed sequentially.

如何在 Powerpoint 中逐步创建宏

In this Module1 (Code) Screen, you can write the code to be executed. I just wrote a

MsgBox("Good Day!!!"). This means MsgBox is a predefined function which will display what is written inside the brackets. In the previous line, the macro name is HI. So whatever you write in that macro HI, it will be executed sequentially when called.

Step 10: After writing the code in the macro, you should close the window and return to Presentation 1. Go to

Macro and click on the name(HI) of the macro and press the Run command which will execute the code.

如何在 Powerpoint 中逐步创建宏

Step 11: When you click Run, you can see the message "Good day!!!" displayed in the message box of Presentation1.

如何在 Powerpoint 中逐步创建宏

Step 12: Successfully create the macro and test it. It's time to add it to the screen so that all code can be executed with a single click. To do this, go to the

Filetab and click on the Options

Scan

Quick Access Toolbar . When you select Can see the custom Quick Access Toolbar, drag down and select Macros.

如何在 Powerpoint 中逐步创建宏

Step 13: All created macros will be listed. You need to choose what you want to add.

Presentation1 HI is selected here because it is the one we created. Click to add. Now the macro HI has been added to the custom Quick Access Toolbar.

如何在 Powerpoint 中逐步创建宏

Step 14: You can modify the macro with icon and name as shown below.

如何在 Powerpoint 中逐步创建宏

Step 15: After clicking the Modify button, you can select the icon from the predefined collection and can change the name as shown in the image below.

如何在 Powerpoint 中逐步创建宏

Step 16: Select the icon and enter the name and click OK. Now you can see the added icon and name in the toolbar

如何在 Powerpoint 中逐步创建宏

Step 17: Go to the home page and you can see the custom icon on top of the presentation . When you want to call a macro, just click on the icon at the top. The macro will run automatically and display the results.

如何在 Powerpoint 中逐步创建宏

Macros are especially used in scenarios where repeated command sequences are required. It could be your custom design or using VBA to code a calculation such as addition in a pre-made way.

The above is the detailed content of How to Create a Macro in Powerpoint Step by Step. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yundongfang.com. If there is any infringement, please contact admin@php.cn delete