Here at BrightCarbon we’re always looking for new ways to improve our own PowerPoint productivity and then share that knowledge with the presentation community (that includes you, by the way!). One of the ways we do this is by using VBA code to automate and extend the functionality of PowerPoint. We publish free PowerPoint VBA code snippets here in our blog for you to use. This article explains how to grab the code from our articles and use it in your PowerPoint project, so that you can take your productivity to the next level!
Visual Basic for Applications (VBA) is a programming environment for Microsoft Office applications. It’s included with your installation of Office by default ( unless your system administrator has deactivated it ) . PowerPoint VBA provides you with a way to do one of two things using macros and add-ins:
int:If you ever find yourself repeating the same task over and over again, VBA could be your new best friend. Let’s say you have 100 slides and you need to unhide all hidden objects across all those slides . That could take you many eye-straining minutes, but with a PowerPoint VBA it takes around a second.
way in PowerPoint to get them back. PowerPoint :Sometimes PowerPoint doesn’t have the feature you need to complete your task . As an example, if you end up deleting default layouts from a template, there’s no easy This article includes PowerPoint VBA code to do just that!
How to open the VBE (Visual Basic Editor)
Getting to meet your VBA friend is very simple. With PowerPoint open and at least one presentation file open, press * on your keyboard. This will open the VBE (Visual Basic Editor):
Adding PowerPoint VBA code
You now have a module ready to paste the VBA code into from one of our blog articles :
‘ PowerPoint VBA Macro to display Hello World message. ‘ Copyright (c) 2019 BrightCarbon Ltd. All Rights Reserved. ‘ Source code is provided under Creative Commons Attribution License ‘ This means you must give credit for our original creation in the following form: ‘ “Includes code created by BrightCarbon Ltd. (brightcarbon.com)” ‘ Commons Deed @ http://creativecommons.org/licenses/by/3.0/ ‘ License Legal @ http://creativecommons.org/licenses/by/3.0/legalcode ‘ Purpose : Displays a dialog box with a Hello World text message. ‘ Author : Jamie Garroch ‘ Date : 06MAY2019 ‘ Website : https://brightcarbon.com/
Sub HelloWorld() MsgBox “Hello World!”, vbInformation + vbOKOnly, “This is my first VBA Macro” End Sub
You should now see something like this: