Getting started with PowerPoint and Visual Basic / VBA


Target Application: Microsoft PowerPoint

Programming Language: VBA

Description: In this tutorial, we will fly over the basics, how to enable Developer Tools in PowerPoint and how to insert a new module. Please note that my macros require some basic VBA knowledge, so I will only mention some essentials while coding. But there are a number of very good sites on the Internet (both German and English), which will get you up to speed.

Step 1: Make sure Developer Tools are enabled. Do do so, in PowerPoint, click on “File > Options > Customize Ribbon”. Then activate “Developer” in the list on the right and confirm with “OK”:

Step 1: Enable Developer Tools

Step 2: Open The Developer Tools by clicking on “Developer” in PowerPoint’s top menu and click on “Visual Basic”. Then, right click on “VBAProject > Insert” and click on “Module” to insert a new VBA module.

Step 2: Insert new VBA Module

Now we can start coding. To run a macro, simply click on the green play button at the top of the VBA Editor (or press F5 on your keyboard). One important final remark: to save a presentation with macros, you have to choose the “.pptm” format.

Handy note: you can also export and import modules. Simply right click on the module name you want to export / import and select the option of your choice.

' This macro is brought to you by DG | ELEVATE YOUR BUSINESS
' Author: Daniel Glöckner
' Last update: 2022/02/26
' Feel free to copy, use, adjust, and share

' Macro purpose: Getting started with PowerPoint and Visual Basic / VBA

Option Explicit ' Forces all variables to be explicitly declared


Sub HelloWorld()

Debug.Print "Hello World - I have created my first VBA macro!"

End Sub