Things You'll Need:
- PowerPoint version 2000 to 2007
-
Step 1
Start PowerPoint and open an existing presentation or start a new one. In PowerPoint 2000 to 2003, go to the "Tools" menu, point to "Macro" and click on "Security." Set the security setting to "Medium." In PowerPoint 2007, click the "Office Button" and then click "PowerPoint Options." Click "Trust Center" and then click "Trust Center Settings." Select "Macro Settings" and then "Disable All Macros with Notification."
-
Step 2
Press the keyboard shortcut "Alt+F11." The VBA editor will open. You can also start the editor by going to the "Tools" menu in PowerPoint 2000 to 2003, pointing to "Macro" and clicking "Visual Basic Editor." In PowerPoint 2007, click the "Office Button" and then "PowerPoint Options." Select "Popular" and then "Show Developer Tab in Ribbon." Close the dialog and click "Visual Basic: in the "Developer" tab.
-
Step 3
Go to the "Insert" menu and select "Module." A blank page will open. This is where the VBA code will be entered.
-
Step 4
Enter the Visual Basic code into the module. VBA must begin with "Sub" and finish with "End Sub." For example, the following code will add a date to each slide.
Sub TimeDate()
Set myPres = Application.ActivePresentation
With myPres.SlideMaster.HeadersFooters.DateAndTime
.Format = ppDateTimeMdyy
.UseFormat = True
End With
End Sub
Check the Resources section of this article for sample VBA codes for PowerPoint. -
Step 5
Close the Visual Basic Editor and return to the PowerPoint presentation. Press "Alt+F8" to open the Macro dialog. Select the name of the code entered and click "Run." Save the presentation to save the Visual Basic code with it.











