How to use VBA in PowerPoint: A beginner’s guide

  • Written by: Jamie Garroch
  • Categories: PowerPoint productivity , Presentation technology
  • Comments: 45

visual basic powerpoint presentation

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 and also offer a PowerPoint automation service . 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!

What is VBA?

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:  

  • A utomate  PowerPo 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.
  • E xtend  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  way in PowerPoint to get them back. 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  Alt+F11 * on your keyboard. This will open the VBE (Visual Basic Editor):  

PowerPoint VBE No Modules

*If for some reason Alt+F11 isn’t mapped on your keyboard you can right click anywhere on the ribbon, select  Customize the Ribbon…  and in the window that appears, tick the  Developer Tab  check box over on the right hand side before clicking  OK  to close the window. Now you can click the  Visual Basic  button within this tab:  

PowerPoint Developer Tab Visual Basic

Adding PowerPoint VBA code  

To add some VBA code, you need a container to put it in so go ahead and click  Insert  from the menu and then select  Module :  

PowerPoint VBE Insert Module

You now have a module ready to paste the VBA code into  from one of our blog articles :  

PowerPoint VBE Module Inserted

Copy the VBA code from  the required blog article  by double-clicking on it and then paste it into the  Module1  window above.  Here’s a very simple example of some code  to display a message dialogue :

You should now see something like this:  

PowerPoint VBA

Because this code is just a single  Sub  procedure called  HelloWorld , it’s referred to as a macro.  

Running  the PowerPoint VBA macro  

Now you have the macro in your presentation you can use  Alt+Tab  to return to the more familiar PowerPoint window. From here, the macro can be run by pressing  Alt+F8  on your keyboard  (or b y  clicking the  Macros  button in the Developer tab)  which opens a window containing a list of available macros:  

PowerPoint VBA

Security Soup

The first time you add VBA code to a file, Microsoft assumes that it is safe because you added it. As soon as you save, close and reopen the file, Microsoft doesn’t know that it’s your code so it will disable it by default. You can tell the Office app to allow your code to run either by signing it with a digital certificate (beyond the scope of this article) or by lowering the security setting for the app. You can do this in PowerPoint by clicking File / Options / Trust Center / Trust Center Settings / Macro Settings and selecting this option shown below:

VBA Macro Settings

Saving your file  

visual basic powerpoint presentation

Once you ’ve added  VBA code  to  your presentation, PowerPoint will  ask you to save it as a  pptm  file  (the ‘m’ stands for macro)  instead of the more  familiar  pptx  format .  You can go ahead and do this to  either  keep a n archive  copy of your  code-enabled  project  or   to  create your personal macro library.  

If you want to distribute your  presentation,   it’s advisable to   save  it  using the familiar pptx format so that  your  recipients don’t see lots of verbose  security  messages  when opening  pptm  files!  

Y ou can  make  your file saveable as a standard presentation again  by  right – click ing  on  each   code module in the  project explorer pane , clicking  Remove   ModuleX …   and either click  Yes   (if you want to keep a backup of the modules independently of your presentation)  or  No   when  asked if you want to save the module before removing it :  

visual basic powerpoint presentation

Now your presentation doesn’t include any code and you can save it as a pptx file.  

So, there you have it.  You now know how to open the VBE, insert a PowerPoint VBA code module, paste code into it, run the macro and save the file in either pptm  or pptx formats. All you need is a cool macro to make your daily life even easier. Keep checking in with our blog for more useful macros – like this one on restoring default slide master layouts!

Got something extra you’d like PowerPoint to do?

Check out our PowerPoint automation service which provides you with a custom solution to your specific needs.

visual basic powerpoint presentation

Jamie Garroch

Principal technical consultant, related articles, how to consistently brand graphs and charts across microsoft office.

  • PowerPoint design / PowerPoint productivity
  • Comments: 1

How do you make sure that your graphs and charts have consistent branding across Excel, PowerPoint and Word? Learn how to create and use custom templates that support your brand identity across Microsoft Office.

visual basic powerpoint presentation

Changes to VBA Macro Security in Microsoft 365

  • Presentation technology / Industry insights
  • Comments: 2

You can do some really cool things in Microsoft Office with just a few lines of Visual Basic for Applications (VBA) - from creating your own custom formula in Excel to correcting branded content in PowerPoint to merging address data for a mail campaign in Word. And sometimes you need to share that VBA solution with colleagues and clients, via the Internet. A change that Microsoft rolled out at the end of March 2022 tweaks the process required by Windows users to gain access to this active content.

visual basic powerpoint presentation

Protecting your prized PowerPoint content

  • PowerPoint productivity / Presentation technology

Our comprehensive guide to password protecting PowerPoint files so your precious presentations stay just they you made them!

very simple, very explicit, very good help for a beginner vba programmer in powerpoint. Thanks

great resource, thanks. I’ve used VBA for years in MSaccess, and this is a good refresher for me.

I am trying to make a ppt file that loops until stopped. then I save it as a video. the ppt ran and looped continuously. Once recorded as video it stopped looping. do you have code to make ppt work when in video format

Hi Charles. As soon as you export a PowerPoint deck as a video all the PowerPoint functionality is removed as the file is magically transformed into an MP4 file, without VBA (sob sob). The only way to make the video loop is to use the looping feature of your video player.

Yeah, your best off recording a screen capture of the presentation running, then cutting it so it loops perfectly.

You can convert the video into gif file so that it will loop

Hi Jamie, thanks for the clear into, I am very new to this so that really helps. I am trying to develop a VBA macro that looks for the left hand mouse key being pressed and held down for more than two seconds whilst over a shape in slideshow mode. Once this is satisfied (i.e. two second press) for it then to hyperlink or take the user to a specified slide or even the next slide worst case.

I realise there is an automated/ built in feature (Action) that does this type of thing for a mouse click or mouse over but I really need a “long press” to activate if possible.

Any help appreciated.

Hi Simon and thanks for a great question. What you’re looking to do is pretty complex because VBA doesn’t natively support mouse actions in the PowerPoint slide show window. But, it is possible to use a Windows API (hence no Mac compatibility) called GetAsyncKeyState to gain access to mouse button click events. I had a look at this and quickly ran into a brick wall because an action link to a macro in slide show mode (Insert / Action / Mouse Click / Run macro) fires on the mouse up event, not mouse down. That means any corresponding VBA timer code can’t run until after the user releases the button and hence too late to detect if it was held down for two seconds. Maybe something could be done with the mouse over event to simulate what you need to achieve? Another approach could be to use the mouse down event on an invisible userform although that is also getting very involved with multiple Windows APIs. Depending on what you’re trying to do, you could also start the timer on click one, change the colour of the clicked shape and show countdown text before reverting to the original colour. If the user clicks a second time before the time expires, then the hyperlink is fired.

Valuable app

Hello I have a question:

Private Sub CommandButton2_Click() ActivePresentation.FollowHyperlink _ Address:=”http://192.168.16.49/?OUT1=ON”, _ NewWindow:=False, AddHistory:=False ActivePresentation.SlideShowWindow.View.GotoSlide (2)

Now it opens Chrome. but how can i make it that it opens te address en afther that shut down chrome.

Hi Tom. Your example should open the default browser at the URL specified by the Address parameter. For more information on the FollowHyperlink method, see this Microsoft documentation: https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.followhyperlink

Thank you very much! It’s exactly what I needed.

I have tried using your randomizing macro with a powerpoint – I must be doing something wrong, because it isn’t putting the slides in random order. Please advise! I copied the macro exactly (using cut & paste), and thought I was following all the directions here for how to use it in the powerpoint. But, no random presentation of the slides. Boo hoo!

Hi Marya. Let’s check that VBA is installed and enabled on your machine. Can you add the following macro to the VBE project (just below the existing one) and try to run it from the PowerPoint window using Alt+F8?

Sub CheckVBA() MsgBox “it’s working” End Sub

Make sure the quotes are the straight type.

I am trying to format my title page so that the number displayed is equal to the linked slide and updates automatically wherever the slide is moved. For example “about us” is on slide #5 and linked, so it goes to slide 5 when you click on the word. I need the number (in a separate text box) to update automatically to the slide number location that the link goes to.

Hi Mary and thanks for the question. It looks like you’re interested in some kind of automated agenda slide builder. That’s a fair bit of code to create and quite complex as it needs to handle events from PowerPoint to detect when slides have moved. It could be possible to write a simpler macro which you run manually each time you want to update that title page. You’d need start by finding a way to identify which objects are your numerical indicators. For example, if you named your objects in the selection pane (Alt+F10) “Agenda Link”, then is simple macro could be a starting place for you: Sub UpdateAgendaNumbers() Dim oSld As Slide Dim oShp As Shape Dim LinkedSlideIndex As Long On Error Resume Next For Each oSld In ActivePresentation.Slides For Each oShp In oSld.Shapes If oShp.Name = “Agenda Link” Then If oShp.ActionSettings(ppMouseClick).Action = ppActionHyperlink Then If oShp.HasTextFrame Then LinkedSlideIndex = Split(oShp.ActionSettings(ppMouseClick).Hyperlink.SubAddress, “,”)(1) oShp.TextFrame.TextRange.Text = LinkedSlideIndex End If End If End If Next Next End Sub

Great wealth of information. Have never used macros before but was looking to use them to help with this situation. At work we use Work Orders (created in Power Point) and are looking to include a sequential number to them (print 50-100 copies of one slide with the numbers) and if possible would like the number to continue from the last printed number…been trying to find some code to help but not having much luck possible partly due to being new to macros

That’s definitely something we could help design for you Joshua. If you’d like to discuss further, please click the Contact button at the top of this page.

I tried this changing the font color of text within the textbox. I used this to change the font color on a mouse over:

Public Sub GraphicHover(ByRef oGraphic As Shape)

oGraphic.TextFrame.TextRange.Font.Color.RGB = RGB(0, 130, 202)

and it works just fine. But, when I move the mouse off the text box, onto the invisible rectangle with this code attached to the mouseover event, it doesn’t change the text color back to it’s original color and remains the color I changed it to mentioned above. I know the mouseover event is being triggered because I checked “Highlight when mouse over” and I am seeing the highlight on the invisible rectangle:

Public Sub ResetGraphicHover(ByRef oCover As Shape) Dim oSld As Slide Dim oShp As Shape Set oSld = oCover.Parent For Each oShp In oSld.Shapes With oShp.TextFrame.TextRange.Font.Color If .RGB = RGB(0, 130, 202) Then .RGB = RGB(121, 135, 156) End With Next End Sub

Any clue where my ResetGraphicHover is failing?

Hi Dave. I took your code and it works for me. You could add a debug line after the For Each… line in the rest macro to check that (a) it’s firing and (b) which shapes are being looked at on your slide. To do that, add this:

Debug.Print oShp.Name

After you run the slide show, check the output in the VBE Immediate pane (Ctrl+G to toggle it).

Hi I am creating an interactive game (matching cards or concentration) in PowerPoint. If the 2 cards match, I need a pop-up text box to appear. If the 2 cards do not match, I need a sound to play.

I understand I need programming to make this happen. Please help or give alternative ways to achieve this. Thanks.

Hi Tammy. Have a look at this article which will help you: https://www.brightcarbon.com/blog/powerpoint-memory-game/

Hi Producer I will like to get comments on macros you can make available to me. Beautiful. I am using this approach frequently to make offline projects. Thanks. S. Fas

Excellent!!! Thank you!

You’re more than welcome Nataša!

Thank you! Is there any option to replace a font in the entire presentation for a specific character. Let’s say, I would like to change font only for dots in the deck but I would like to keep the rest in the original font. Any idea please? Thank you so much!

Hi Jan. You might be able to use the Replace Fonts feature found in the Home tab of PowerPoint under the Replace menu at the far end of the ribbon. If you need to use VBA then set up a nested loop to iterate all shapes within all slides and then use the oShp.TextFrame2.TextRange.Font object to change the font.

Exellent explenation. so beutiful. I am creating an interactive e learing quiz. Thanking you.

Hello! I have a client who’s interested in using tagging to help create searchable content within slides. For example, they have four different categories for slide content across multiple presentations (Overview, Market, Product, Country). I’d like to assign a different shape to represent each of the four categories, where a blue square might represent Overview slide content. Then, when someone uses the keyword “Overview” to search for overview content (on Teams or SharePoint), these slides are easily identified. Is this something that’s possible with VBA code?

Hi Linda. That’s a very good question! Given the need is to search via SharePoint, VBA probably won’t help here as the PowerPoint file needs to be opened for VBA to examine its content. I have a sneaking suspicion that if you add keywords in the Tags field under File / Info that SharePoint may use this. But, that’s at the file level rather than the slide level. We have a PowerPoint add-in called ShowMaker that might be of interest as it allows you to add category metadata to slides and then the presenter can use that to filter the deck and export the required content. You can find an overview of it here: https://www.brightcarbon.com/showmaker/ and we could set up a demo if you’re interested (please use the Contact button at the top of this page if that’s the case).

I’ve just created an elearning package in PowerPoint using VBA , I didn’t realise it could sum up text boxes within PowerPoint to mark the qualification at the end. Also used AWS text to speech over the top of the learning . Looks great

Sounds like a fun and successful project Stu! Thanks for sharing 🙂

I have a bit of a tricky one but hoping it is possible to do with VBA. We offer training services to multiple clients that can be customized but the majority of training is consistent from one client to the next (main changes are the slide masters/formatting and addition/removal of certain sections).

What we want to do is create one master (or multiple) training document(s), and then use VBA’s to link it to the client specific PowerPoint. We want to link the master rather than using the “reuse slide” command so that if we update one file the other will automatically update as well.

Not sure if it matters, but our company uses sharepoint as storage

Hi Dave and thanks for a great question. VBA is an excellent solution for automating a manual process. In general, if a person can perform a task manually via a sequence of pre-defined steps then VBA can do it automatically, faster, and with less chance of mistakes for something done many times. We’d be happy set up a call to discuss your needs further and see what could be automated with VBA. If that’s of interest, please use the contact button at the top of the page and mention my name in the form.

PP does not seem to have the record macro feature. To write vba code in PP by someone who only worked with vba in excel, would require some prior knowledge. Is there a summary of the most common objects, methods etc to refer to?

Hi Reef. You’re correct that there’s no VBA macro recording feature in newer versions of PowerPoint. The best place to start learning is by purchasing a book (there’s one called “Mastering VBA for Microsoft Office 365” on Amazon or reading the extremely exciting Object Model documentation from Microsoft: https://docs.microsoft.com/en-us/office/vba/api/overview/powerpoint/object-model

Hi Greeting I had made a game in power point using VBA codes. At last it generate a report every time a candidate conduct the game . My requirement is to generate result in same excel sheet after conducting the game. Like Row 1 player 1 result Row 2 player 2 result I need your help Regards

Hi Asheesh. It’s possible to use VBA to get PowerPoint to “talk” to Excel (and other Office apps) but it’s a bit complicated to mention in a comment here. We’d be happy to help if you’d like a quote or if you want to try yourself you could start with this: Set oXL = CreateObject(“Excel.Application”) and have a look at some online examples. I’d also recommend the book “Mastering VBA for Microsoft Office 365” available from Amazon.

If there are two colors of font in the textFrame, how to change the font of one color through VBA?

Hi Bruce. You could either iterate through the Characters collection of the TextRange2 object or the Runs collection which returns all of the TextRanges with the same style. Example: ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Runs(1).Font.Fill.ForeColor.RGB

Hi – can you help, please?

How can I change the font color and size of the message box? What code will work and where will I put it? Creating an interactive game in powerpoint. Thank you!

—– Sub Correct() Points.Caption = (Points.Caption) + 10 Output = MsgBox(“Your answer is correct, well done!”, vbOKOnly, “Correct Answer”) ActivePresentation.SlideShowWindow.View.Next End Sub

Sub Incorrect() Points.Caption = (Points.Caption) – 5 Output = MsgBox(“Your answer is incorrect.”, vbOKOnly, “Wrong Answer”) ActivePresentation.SlideShowWindow.View.Next End Sub

Sub Reset() SlideLayout.Points.Caption = 0 ActivePresentation.SlideShowWindow.View.Exit End Sub ———-

Thanks for your explanation.

Hi Jamie, Is there any way to keep my macro save in a file so I can utilize on any other PPTs equivalent as.normal.dotm for Word, .xlam(add-in) for Excel.

Hi Anurag. Thanks for the question and Happy New Year! The best way to do this would be to export your project as a ppam and activate it as an add-in via the PowerPoint add-ins UI. Save your ppam in %AppData%\Microsoft\AddIns and then in the Windows PowerPoint Developer tab, click PowerPoint Add-Ins and add your ppam from there. If you’re not code-signing your VBA project, you may need to adjust Trust Centre settings. You could optionally build an EXE/MSI installer package for Windows and PKG for macOS, although that is a more complex topic.

Join the BrightCarbon mailing list for monthly invites and resources

BrightCarbon provided us with a fantastic service ... and left us with a presentation that secured us a £4 million contract. BrightCarbon is our first choice for presentations in the future. Matthew Mitchell NHS

visual basic powerpoint presentation

VEGA SLIDE

How to Open and Use VBA Macro Editor in PowerPoint

visual basic powerpoint presentation

Are you tired of manually performing repetitive tasks in PowerPoint? Look no further than the open VBA Macro editor in PowerPoint 2021. Whether you’re a seasoned PowerPoint user or just getting started, understanding how to use the VBA Macro editor can drastically improve your workflow.

Table of Contents

What is vba.

VBA stands for Visual Basic for Applications. It is a programming language that is used to extend the functionality of Microsoft Office applications like Excel, Word, and PowerPoint.

A VBA macro is a piece of code written in VBA that performs a series of tasks or commands in a Microsoft application. They can automate repetitive and complex tasks to save time and manual work. So, VBA is the language used to write macros, while macros are the code that is written using VBA.

Steps to open the VBA macro editor

1. Create a new presentation or open an existing one. Then go to the File tab and click on Options .

visual basic powerpoint presentation

2. Click on Customize Ribbon , and check the box next to Developer and click OK .

visual basic powerpoint presentation

3. Go to the Developer tab and click on Visual Basic . Another way is to press Alt + F11 on your keyboard. This will open the VBA Macro editor in a separate window.

visual basic powerpoint presentation

4. In the VBA Macro editor, you can see the Project Explorer pane on the left, which shows all the modules and objects in your presentation. You can also see the Code window on the right, where you can write and edit your VBA code.

visual basic powerpoint presentation

5. To create a new module, go to the Insert menu and click on Module .

visual basic powerpoint presentation

6. A new module will appear in the Project Explorer pane with a default name like Module1 .

visual basic powerpoint presentation

7. To create a new macro, type Sub followed by a name for your macro in the Code window. For example, Sub HelloWorld() . Then press Enter and type End Sub on a new line. This will create a basic macro structure with a name and an empty body.

visual basic powerpoint presentation

8. To write your VBA code, type it between Sub and End Sub lines. For example, to make a message box pop up with the text “Hello World”, type MsgBox “Hello World” on a new line.

visual basic powerpoint presentation

9. To run your macro, go to the Run menu and click on Run Sub/UserForm or press F5 .  

visual basic powerpoint presentation

10. You should see a message box with the text “Hello World” appear on your screen.

visual basic powerpoint presentation

You have successfully opened the VBA Macro editor in PowerPoint 2021 and created your first macro. You can now explore more VBA features and functions and create more complex and powerful macros for your presentations.

How do I open the VBA editor in PowerPoint?

The quickest way to open the VBA editor in PowerPoint is by pressing Alt+F11 . Laptop users may need to combine it with Fn .

You may also enable the Developer tab. Go to Developer > Macros . Select the macro and click Run .

How do I edit VBA code in PowerPoint?

Open the VBA editor by pressing Alt+F11 . Select the macro in the Macros dialog box and click Edit . This opens the code for editing.

How do I create a new VBA module in PowerPoint?

visual basic powerpoint presentation

To create a new VBA module in PowerPoint, first open the VBA editor by pressing ALT+F11 . Once the VBA editor is open, insert a new module by going to Insert > Module . This will insert a blank code module. This allows you to automate tasks and add functionality in PowerPoint using VBA programming.

How can I assign a keyboard shortcut to run a macro in PowerPoint?

To assign a keyboard shortcut to a macro in PowerPoint, first create the macro and write the VBA code. Then go to the File > Options > Customize Ribbon . In the box on the left, select Macros . Then select the macro you want to assign a shortcut to from the list on the right.

Click the Add button to add it to the customizable shortcuts. Click the Modify button. In the Modify Button dialog box, enter the keyboard shortcut you want to assign in the Press new shortcut key box (e.g. “^+G” for Ctrl+Shift+G). Click Assign , then OK . Now you can quickly execute the macro by pressing the keyboard shortcut instead of going through the ribbons.

How can I debug VBA code in the PowerPoint editor?

I find the easiest way to debug VBA code in PowerPoint is to use the built-in debugging tools.

First, I open the Visual Basic editor by pressing Alt+F11 . Then I set breakpoints in my code by clicking in the left margin of the line numbers. When I run the code with F5 , it will pause execution at any breakpoint I set so I can step through my code line-by-line with F8 and inspect variables.

I also use the Immediate window (Ctrl+G) and Debug.Print statements to output variable values. With these tools, I can methodically walk through my code to identify and fix any issues.

About The Author

Rully novrianto, related posts.

How to Merge Slides in PowerPoint

How to Merge Multiple Slides in PowerPoint

visual basic powerpoint presentation

How to Convert PowerPoint Slides to JPEG Pictures

visual basic powerpoint presentation

How to Use Smart Guide on Microsoft PowerPoint 2013

visual basic powerpoint presentation

How to Make Text Appear Transparent in PowerPoint

visual basic powerpoint presentation

Username or Email Address

Remember Me Forgot Password?

First name *

Last name *

Mobile Number *

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our privacy policy .

Get New Password

PowerUP with POWERPOINT

3. Getting Started with VBA

powerupwithpowerpoint

  • December 3, 2023
  • PowerPoint VBA

In previous blog you learned some basic of VBA. This Blog will explain how to access the VBA Editor, how to write simple scripts in VBA, how to attach those scripts to buttons and objects, and how to protect your scripts with a password. When you complete reading this blog, you will know the basics of writing a script and using it in a PowerPoint presentation, and you will be all ready to do some interesting things with VBA.

  • Accessing the VBA Editor

Once you start a PowerPoint project, you get into VBA by holding down the ALT key and hitting the F11 key (Option-F11 on a MacOS). Alternatively, go to the Developer tab of the Ribbon and click on Visual Basic. If you don’t have the Developer tab, go back to blog#1 to review how to get it.

visual basic powerpoint presentation

At this point, you should see two small windows on the left (the Project window and the Properties window) and a large blank area on the right of the screen.  

visual basic powerpoint presentation

You also might not see either the Project window or the Properties window; you can get them back by choosing them from the View menu.

visual basic powerpoint presentation

Choose Module from the Insert menu , and you will get a window in the blank area. The window probably will be named “Module1”. This is where you will write your VBA procedures.

visual basic powerpoint presentation

While we are here, let’s write one VBA code. Type the following:

Note that the computer will type the End Sub and the parentheses for you if you just hit Return or Enter on your keyboard after typing “ Sub SayHello ” .

visual basic powerpoint presentation

Now go to the Run menu , and select Run Sub/UserForm . You should get a message box that says Hello World!

visual basic powerpoint presentation

Congratulations! You have just written and executed your first VBA procedure successfully. Click the OK button, and you can do some more.

  • What If It Didn’t Work?

When you type code, it doesn’t always work the first time (or the second time or the third time or . . .), i will give lots of great ideas in my upcoming blogs for fixing what’s wrong with your code; but for now here’s a quick tip. After typing some code, make sure that it starts with Sub and ends with End Sub . The next most common mistakes are: putting a space between Say and Hello on the first line (it should be one word) and getting the quotes wrong around Hello World! (they’re regular, ordinary double quotes, and when you have an open quote, you need a close quote). Check everything carefully, and you’ll be able to get this to work.

  • Be a Scripter: Change Things in Quotes

If your goal is to be a programmer, you should try to understand every detail in every line of code. If your goal is to be a scripter, you should have a basic understanding of what the code does, and you should try to understand as much of the details as you can. But the most important thing you can understand as a scripter is what you can change. One clue is that you can change most things that are in quotes. In this code, the word Hello World! is in quotes, and “ Hello World! ” popped up on the screen when you ran the procedure. If you want something else to pop up on the screen (like “ Hello, PowerPoint! ” or “ My First VBA code ” or “ My Name is, Bla bla ”) then put that in the quotes in your code instead. Give it a Try..!!

  • Subroutine, Procedure, or Macro

What do we call the code that you just wrote (the stuff that starts with Sub and ends with End Sub )? The word Sub is short for subroutine . It is commonly referred to as a procedure , and these terms will be used in all of my upcoming blog posts. It could also be referred to as a macro , and you will see that term in the Developer tab of the Ribbon (refer image below). In short, any of those terms is correct and are equivalent.

visual basic powerpoint presentation

  • Attach Your VBA Script to a PowerPoint Button

Now that you have a Macro written, you may want to access it from within PowerPoint. You can do this by assigning/attaching this Macro to a button (or any drawing shape that you want).

Assuming that you are still at VBA editor, you can click on old style PowerPoint icon on top left corner to Return back to Microsoft PowerPoint (refer image below) .

Note: You can also close the Visual Basic Editor by clicking on the X in the upper right-hand corner of the screen. Don’t worry about losing your VBA scripts when you close the editor. Your VBA scripts are part of your PowerPoint presentation. When you save your presentation, your scripts will be saved with it. When you return to the editor, your scripts will still be there.

visual basic powerpoint presentation

Now to Attach Your VBA Script to a PowerPoint Button, you must first add an action button to your slide. You will find action buttons under shapes menu, at the bottom most section.

visual basic powerpoint presentation

You can pick any one of the action buttons and draw it on the slide. As soon as you finish drawing the button, by dragging the mouse to form the button or just clicking where you want the button to appear on the slide, you will be presented with the Actions Settings dialogue box . Choose Run Macro , and select SayHello (the name of the procedure you just wrote) as the macro to run. Click OK .

visual basic powerpoint presentation

Buttons are only active in Slide Show View, so go to Slide Show View by pressing F5 key on your keyboard ( Note : If you have more than one slide, then press ‘ Shift+F5 ’ keys to start slide show from current slide). Now, click on your action button, and you should get the same “ Hello World! ”  message you got earlier when running your Macro.

visual basic powerpoint presentation

Now go back to Normal View (also known as Edit View) by hitting the Escape key on your keyboard. To finish your button, right-click on it and choose Edit Text from the fly-out menu or select the button and just start typing. You can now add text to describe what your button does. This text will show up on the button, so users will know what they are clicking when they click your button. For this button, you might type “ Say Hello ”.

  • Attach Your VBA Script to any Object/Shape

Not just to a button, you can assign your VBA script to any object you want. Use the drawing tools to draw a shape (Choose Shapes menu from the Insert tab of the Ribbon),  Once you have drawn the shape, click on it to select it. Now choose Action from the Insert tab of the Ribbon, you will get the same dialogue box as in case of action button, you can choose Run Macro and the SayHello macro, exactly as you did earlier. Now you can click on the drawn object just like you can click on the button.

visual basic powerpoint presentation

This method works for any PowerPoint object, not just the ones you draw yourself. You can insert clip arts, pictures from other sources, and even make text in your slide clickable by highlighting the text and following the same steps.

  • Securing Your VBA Script

In many circumstances, you may not want others to see your VBA Script (Example: You have written VBA script for a Quiz game and you don’t want to reveal their answers) and It is very easy to protect your VBA code with a password. Return back to VBA Editor where you edit the VBA code, select VBAProject Properties from the Tools menu and click on the Protection tab. Check the box that is labeled Lock project for viewing , type a password in the “Password” box, and type the same password in the “ Confirm password ” box and then click Ok .

visual basic powerpoint presentation

Now, whenever you want to view or edit the VBA code, you will be asked to type this password. Don’t forget it, else even you will not be able to access your own project.!!

Leave a Reply Cancel Reply

You must be logged in to post a comment.

Trending now

visual basic powerpoint presentation

PowerPoint Tips Blog

Helping you with presenting, PowerPoint, and speaking

Easily create a quiz in PowerPoint using Visual Basic for Applications

April 11, 2001 by Ellen Finkelstein 52 Comments

Did you know it’s possible to create your own quiz slides in Microsoft PowerPoint using its macro functions and doing a little programming in Visual Basic for Applications (VBA)?

You can use quiz slides to make presentations more engaging and fun. They work something like this: Each slide asks a question and displays answer choices. Quiz-takers  then click on the answer they think is correct. If they answer correctly, a Congratulations message appears and they automatically move on to the next slide. If they choose a wrong answer, they receive a “try again” message. The slideshow will not advance until they select the correct answer.

You may think that working with VBA is too complicated, but it’s easier than you might think. This VBA code is easy to understand and, for this tip I was able to use Visual Basic to create a 10-slide quiz in less than an hour.

Step 1: Create multiple-choice slides

The first step is to create the question slides. In PowerPoint, start a new slide using the Title Only slide layout. Type the first question in the title placeholder.

To add the multiple-choice answers, go to the Draw toolbar and choose AutoShapes> Action Buttons. (2007: Home tab> Drawing group> Shapes> Action Buttons section) Then choose the blank action button. Now click on the slide and the new button will appear. When the Action Settings dialog box appears, choose Cancel. You’ll return to this box later in the tutorial.

Resize and position the button on the slide. For consistency, size the button to allow for the longest text answer. Format the button as desired.

Right-click on the button, choose Add Text from the shortcut menu, and type the first answer. Now select the button, copy it to the Clipboard, and paste  additional copies of the button graphic for the remaining answers you’ll need on the slide.

When all the buttons are in place, select each individually and edit its text. You can also align and distribute the answer buttons on the slide. Select them all. Choose Draw toolbar> Align or Distribute, Align Left, then Draw toolbar> Align or Distribute> Distribute Vertically. (In PowerPoint 2007: Drawing Tools Format tab> Arrange group> Align button> Align Left, then Align button>Distrubte Vertically)

Repeat this process to create each additional question slide.

Tip: Within the Slide Sorter view, you can COPY (CTRL+C) the first question slide and PASTE it as many times as needed to quickly create the remaining question slides. Then return to Normal view to edit each slide’s text.

On your final quiz slide, create an action button with the word End, and place it on the slide.

Step 2: Create macros

When the Q & A slides are done, you’re ready to create the macros using PowerPoint’s Visual Basic Editor. Before you begin, make sure that only the presentation you are currently working on is open.

To open the Visual Basic Editor, choose Tools> Macro> Visual Basic Editor.

In 2007 and later, you first need to display the Developer tab if it isn’t already displayed. (By default, it is not displayed.)Choose Office button> PowerPoint Options. In PowerPoint 2007, in the Popular category, check the Show Developer Tab in the Ribbon check box. In PowerPoint 2010 and 2013, go instead to the Customize Ribbon category. On the right side of the dialog box, check the Developer check box.

Then, to open the Visual Basic Editor, choose Developer tab> Code group> Visual Basic.

The editor opens in a new window. The right side of the window will be gray. From the insert menu choose module and you’ll see a blank white area where you can type a macro. We’ll create three macros.

We’ll start with the code for the wrong answer. In the big blank space on the right, type the following on three lines:

Sub Wrong()

MsgBox (“Sorry, that’s not right. Please try again.”)

In certain situations, if you make a mistake, the editor will warn you, but the message may not be clear to you. Most often the mistake is a result of mistyping the code. You may have left out one of the quotation marks or the closing parenthesis at the end of a line. Double-check your typing and make adjustments until the Editor shows no warnings.

Next is the code for the right answer. At the end of the line reading “End Sub,” press Enter. This begins a new code group. Then type the following four lines:

Sub Right()

MsgBox (“That’s right!”)

SlideShowWindows(1).View.Next

This code is similar to the previous macro, except for the third line, which advances the quiz-taker to the next slide.

On the final slide, you don’t want the slideshow to advance to the next slide because that starts the presentation all over again. Instead, you want viewers to use a button that exits the slideshow. So after the previous “End Sub,” press Enter again and type your final piece of code:

Sub RightLast()

MsgBox (“Congratulations!”)

Step 3: Attach macros to buttons

To return to PowerPoint from the Visual Basic Editor, click the View Microsoft PowerPoint icon (upper left-hand corner, under the File menu link). Leave the Visual Basic Editor open in the background. In PowerPoint, save the presentation, as this saves the new macros as well.

Go to your first question slide and select the button with the correct answer. Note: Select the entire button, not just the text on the button. You do this by clicking on the border around the edge of the button.

Right-click the button and choose Action Settings from the shortcut menu. The Action Settings dialog box appears. Choose the Mouse Click tab, and in the Action on Click section, check the Run Macro option and select your new Right macro from the drop-down list. (Notice that all the macros on this list are named for the three pieces of code you created in the Visual Basic Editor.) Click OK. ( Note: Thanks for one of the commenters below for pointing out that you may have to choose Hyperlink instead of Action Settings.)

Now select each of the wrong answers and follow the same procedure, except select the Wrong macro from the drop-down list.

Before going on to the other slides to assign the proper macros, try out the buttons on the first slide. Go into Slide Show view. Click on a wrong answer. A text-message box should pop up indicating you have chosen the wrong answer. Click OK to close the box. Check the other wrong answers on the slide to make sure they also work. Finally, select the correct answer. This time, the text-message box should indicate you have chosen the right answer. Click OK and the slideshow will automatically advance to the next slide.

With the first slide working properly, edit the rest of the presentation, attaching the appropriate macros to the buttons. On the last slide, assign the RightLast macro to the correct answer  so that quiz-takers stay on the last slide.

Remember the End button you created on this final slide? Right-click on that button and choose Action Settings. In the Action Settings dialog box, choose the Hyperlink To option and choose End Show from the drop-down list. Click OK. Quiz-takers can use this button when they’re finished answering all the questions.

Be sure to save the PowerPoint file.

Step 4: The final setup

To prevent the quiz-takers from clicking through without answering all the questions, choose Slide Show> Set Up Show. In the Set Up Show dialog box choose the Browsed at a Kiosk (Full Screen)” option under the Show Type area. Click OK. With this setting, the only way someone can get out of the presentation is to use the ESC key.

final setup

Now, go into Slide Show mode and try your quiz, making sure all wrong answers and right answers use the proper macro. If you get a message about macros, you’ll need to tell PowerPoint that you want to run the macros. This is due to PowerPoint’s security settings.

That wasn’t so difficult, was it?

The concept here is from David M. Marcovitz’s book, Powerful PowerPoint for Educators .

Related posts:

  • Create a quiz in PowerPoint
  • Create a quiz game
  • Create a visual menu
  • Create a Visual Summary Slide

52 Leave a Reply

avatar

thanks for the codes !! :))

Daniel Coleman

Hello there,

When I run my presentation, I can not seem to get this to work. I click on the options and the do not run to the next slide or come up wrong. It stays on the same slide and when I click on a box a dotted line appears around it!

Ellen

That is usually because of PowerPoint’s security settings. I’d need to know which version of PowerPoint you have to show you how to change them. But start with Tools>Options or File/Application Button>Options.

Rick Owens

I have created a quiz integer add and subtract macros button….that was eay. But when I use my required action button to run my Macros, such as a progressive score button, the Macros window “pops-up” within that slide and is much smaller than the slide itself. It works just fine but is there a way to for the button to make this score open in it’s own slide to keep score? In other words, can I make that pop-up window an actual slide? Thanks for your input please.

I’m not sure I understand and I’m not a programmer, but you can programmatically create a new slide and display the results of calculations there. In my book PowerPoint for Teachers I have a chapter on creating a quiz with VBA using code from David Marcovitz. It displays the score on a list slide that the code creates on the fly. At http://www.loyola.edu/edudept/powerfulpowerpoint/, you can look at some of his code. He lists it by chapter and I don’t know which chapter would have the code you need. If you’re creating more complex quizzes, I recommend that you buy his …  Read more »

golfcents

Hi isnt SlideShowWindows(1).View.Next supposed to be SlideShowWindow(1).View.Next no s after window???

either way I get syntax error but this almost works ActivePresentation.SlideShowWindow(1).View.Next

actually all I want is a text box to hold a value (a score) and have a button add 1 to the value in the text box…

can you assist – you can answer at my email – and if it works feel free to add to this post

Try it like this: ActivePresntation.SlideShowWindow.View.Next For more information than that, you’d need to ask a programmer, which I am not. Go to the PowerPoint Discussion Group at http://answers.microsoft.com/en-us/office/forum/powerpoint?tab=all and ask the question there. A few programmers frequent the forum.

Adam

Great work. The problem I have is when people take the test and they know programming they can right click on the buttons and look at the hyperlink to discover the correct answer. How do I fix that?

Rose Pierce

Hello, thank you for the info- I have set up several quizzes with your instructions. I know I can easily assign a sound to an action box. How do I asign a sound to the VBS message box? Right now, every time the message boxes appear, the “error” sound is there. I would like to keep it for the wrong answers, but have an “applause” sound for the right answers. Thanks!

Rose, My VBA skills are pretty limited, so I don’t know how to add a sound in VBA. The error sound might be, well, an error in the code. You might try a non-VBA technique for creating the quiz, but I only have that written out in my ebook, 101 Advanced Techniques Every PowerPoint User Should Know.. You can see a demo at http://www.ellenfinkelstein.com/pptblog/create-a-quiz-in-powerpointdemo-of-technique-7-from-my-e-book/ . Ellen

Sammer

for some reason when i right click my action button, i dont get the action settings, how do i get the action settings? Thanks

Clint

Hello Ellen,

How can I get my Powerpoint quiz to self grade? I would like for my students to print and send me their results.

Clint, I have instructions in my book, PowerPoint for Teachers. You can find it on Amazon. It’s too much to put in a blog post–the instructions take up a whole chapter of the book!

Dilip Singh

I want to Visul Basis coding any quiz contest.

In addition to the code on this page, I have a whole chapter in my book, PowerPoint for Teachers. You can buy it from Amazon.com at this link: http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X

Hashim Elhadi

Hello Ellen Thank you for I see as great work which will be my first step in the world of VBA. I’ll always remember this tutorial. For some reason the (right) does not make the slides advance, it shows the message and remains at the same slide

It could take quite a while to troubleshoot and I’m not a serious VBA programmer. I suggest that you go to Microsoft’s discussion group and there are VBA programmers there who will help you. http://answers.microsoft.com/en-us/office/forum/powerpoint?tab=all

beatrice

Sammer wrote “for some reason when i right click my action button, i dont get the action settings, how do i get the action settings?”

That’s becuase Ellen got it WRONG !!! In PowerPoint 2007 you don’t get “Action Settings” on right-click, you get “Hyperlink”, and from there you can progress.

Ashu khan

Hi Ellen i want a visual basic codes for making quiz.Its very important for me so please i am requesting u to give me a visual basic codes for making quiz

Ashu, My book, PowerPoint for Teachers, has a entire chapter on this topic. Check it out at http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X

Kris Mac

I am trying to make a powerpoint presentation were the users will need to enter an answer in the text box but make it so it will only allow to the next screen when the correct text has been entered and or flash up if incorrect, i dont know if this is possible as i am quite new to making presentations. Any ideas would be a great help.

That’s how the quiz in this tip works. You can do it without VBA coding as well. It’s one of the techniques in my ebook, 101 Advanced Techniques Every PowerPoint User Should Know ( http://www.ellenfinkelstein.com/estore/101advancedtechniques.html ) and also in PowerPoint for Teachers ( http://www.amazon.com/gp/product/078799717X?ie=UTF8&tag=ellenfinkelstein&linkCode=as2&camp=1789&creative=9325&creativeASIN=078799717X )

Martin Bush

Hi Ellen, you might like to know that you can now create an online multiple-choice “answer until correct” quiz, or alternatively a timed exam, simply by uploading a PowerPoint document with one question per slide to QuizSlides.com . (Disclosure: I’m the founder!)

dr ravish

hi ma’m thanks for the guidance..really appreciate clarity of explaining about ppt quiz. really awesome

mhelia

im doing a quiz program using vba.. and i find it so hard .. tnx for the tips anyway :)) Godbless

Prasad

i was not getting actually the result, when i was clicked it just blink & no popup had displayed 🙁 please rply me @ my mail or here .. i m in needy position yar..

Mengheng LIM

Thanks, Just a reminder for the new user, please make sure that you save the file as the pptm(it means enable macro)

Lissa Bell

I have PPT 2008 which apparently does not accept macros. Is there a workdaround?

Ellen Finkelstein

PowerPoint 2011 brought back support for macros, so I would upgrade.

BELAID

Good afternoon, Thanks very much, Ellen, for all these topics.I have learned a lot with your interesting blog.Can i ask you for tutorials about drawing technique’s with powerpoint 2007.

fabry

Hello, if in a quiz, I wanted to keep track of the correct answers as I do?

Ellen Finkelstein

To create a quiz that keeps track of correct answers, you need some more VBA. I have a chapter in my book PowerPoint for Teachers that covers this topic. ( You can buy it on Amazon.com here. ) For more information, I recommend David Marcovitz’ book, Powerful PowerPoint for Educators, which is all about using VBA to create quizzes. You can buy that here . It’s an expensive book because it’s considered a textbook.

Lisa

Is it possible rather than having just the “Incorrect answer” response but a Incorrect with an explanation for why it is wrong? So you would need individual wrong pop ups?

Nana Yaw

Thank you and can you please help me to add time to a form in the Visual Basic integration with powerpoint?

uroosa

i want to create quiz game in vb6 with database connectivity how???

Mark

I have greated a quiz and its works well, however i would like to use a vba code to work out how long the quiz takes and then convert this is questions right per hour

shadow

How can you prevent the file not to be open within powerpoint. Because, if you open the file within the application they would see all slides.

samson

Please email me step by step instruction on how to do a powerpoint quiz .what about doing a power point games

I did a search in my blog on “games” and came up with these: http://www.ellenfinkelstein.com/pptblog/create-a-quiz-in-powerpointdemo-of-technique-7-from-my-e-book/ http://www.ellenfinkelstein.com/pptblog/create-a-quiz-game/ Have fun!

Rio

as a beginner this article say quite understand and very useful for me. thank you

Abhishek Kumar

thanks a lot I found it too useful and I knew actual use of macro in ppt.

I am making a game with PowerPoint and I really need this and it is very helpful.

If you know then please tell me for control action button with key board like if I want to move the object or fire by object then how to assign a specific button for it from keyboard in PowerPoint 2010.

Thank you again.

ALABI JACOB

Good post, I made a tutorial on my blog with feature of PowerPoint VBA for Great quiz. You can find my blog Here

T.G

Thanks for the tips… Works perfect!

dennis

Thanks for the code. I also wish to know how one can code macros so that the dialog box will serve as an avenue for password. So that a user needs to put in the required password before the slide moves to the next. I can find a way out. I don’t want my kids going through my set questions. Thanks.

Lhay

Thanks a lot! It really works perfectly. Now I can make my quizzes more exciting for my students.

Ahmed Hassan

thanks a lot ! it works . but i have a problem i put sound in the macro and gave him the path of sound when i put the power-point file in anther PC it does’t work . how can solve this problem plz ?

Sharita Cleland

Nice text, thanks!

Stephen Lines

Clear instructions (thanks), but none of my buttons work (no messages).

I’m using PP 2016 running in Windows 10 which I suspect is the problem/difference.

This is the closest I’ve come to being able to put live quizzes into my presentations. Frustrating, but hoping you or someone out there can help put the final brick in place (probably something ludicrously simple!).

Keep up the good work, and thanks for your unconditional approach to sharing your skills.

Much appreciated,

Nanda Kishore

Very useful information. I have a question, When i use the Right macro for right answer, it pop-up’s saying click ok, which i click it redirects to next slide. But, I need to put answer source as a button beside OK button when it says correct answer.

If i use MsgBox again, it is feasible to do. But i want this way, Is it Possible ?? Please Suggest me what is the best way to get my output !

Kshitij Malik

how can i build a project using ms office applications that can generate various quizzes automatically?

wpdiscuz

an introduction to visual basic

An Introduction to Visual Basic

Sep 30, 2014

880 likes | 2.05k Views

An Introduction to Visual Basic. Terms & Concepts. What is VB?. Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows. VB has been developed through many versions. This course uses VB 6.0. Getting Started.

Share Presentation

  • visual basic
  • programming language
  • project explorer window
  • vb6 addresses problem solving

giulio

Presentation Transcript

An Introduction to Visual Basic Terms & Concepts

What is VB? • Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows. • VB has been developed through many versions. This course uses VB 6.0

Getting Started VB6 addresses problem solving “from the outside, in.” In other words, the user interface is designed and created first, then it’s Events are programmed.

The Windows GUI • The Graphical User Interface is the means through which users can interact with programs. • Each window is called a form. • Each form is populated with controls.

The Windows GUI • There are many different kinds of controls: • Label • Text box • Option button • Check box • Command button • Image • List box • Drop-down list • Frame • Line / Shape

A Sample Form The Tools » Options dialog box in MSWord

Programming Language Paradigms • Procedural • Functional • Declarative • Object-oriented • Event-driven In this paradigm we develop projects rather than programs.

Object Oriented Programming A VB project consists of: • Objects - the nouns of OOP • forms and controls are examples of objects. • Properties - the adjectives • size, location, name, caption • Methods - the verbs • Move, Print, Resize, Clear The dot operator • Object.property is the syntax for referring to a particular property of a particular object.

The Components of a Project A VB project consists of at least two files: • projectName.vbp - the project file • a text file that lists the names of all the other files in the project • formName.frm - a form module • a description of all objects and their properties for each form, AND the Basic code written to handle events

Planning Design the interface Plan the properties for all the controls Plan the Basic code Implementing Define the interface Set the properties Write the Basic code Creating VB Projects

Working with VB VB has 3 modes: • Design • The editor is used to create and change programs. • Run • Executes the program. • Break • Running is suspended to report an error in the program.

The Visual Basic Environment • Form Window • Project Explorer Window • Properties Window • Form Layout Window • Toolbox • The Main VB Window • Toolbar

The Visual Basic Environment

  • More by User

Introduction to Visual Basic

Introduction to Visual Basic

Introduction to Visual Basic. Language developed for special-purpose Windows applications – 1991 Uses IDE – Integrated Development Environment Code based on Q-Basic Event Driven Prebuilt graphical components (controls). Two Time Frames. Design Time – when application is being built

430 views • 27 slides

Introduction to Visual Basic

Introduction to Visual Basic. What it is, and a simple program. Mike Thelwall University of Wolverhampton, UK. Origins through BASIC. B eginners A ll-purpose S ymbolic I nstruction C ode A simple programming language Developed mid 1960’s

527 views • 28 slides

Introduction To Visual Basic 6

Introduction To Visual Basic 6

Introduction To Visual Basic 6. Announcements. Thursday, Oct 9th, 7:30PM, C106 Lloyd Douglas (NSF) Diversity in Science-Who needs it? 5 extra credits. About the extra credit Please submit printed copy. Don’t hand in through blackboard system or send email. . Programming language.

520 views • 33 slides

Introduction to Visual Basic Programming

Introduction to Visual Basic Programming

2. A client is to me a mere unit, a factor in a problem.Sir Arthur Conan Doyle ...if the simplest things of nature have a message that you understand, rejoice, for your soul is alive. Eleonora Duse Protocol is everything. Francoise Giuliani They also serve who only stand and wait. John Mil

1.38k views • 115 slides

Visual Basic Introduction

Visual Basic Introduction

Visual Basic. One of the most widely used windows programming language.Relatively easy to learn.Create professional looking systems very quickly.Useful for prototyping.Internet connectivity.Provides wizards to assist users.. VB and IDEs. The VB environment can be used to create and execute

331 views • 21 slides

Introduction to Visual Basic Programming

2. OBJECTIVES. In this chapter you will learn: To write simple Visual Basic programs using code rather than visual programming.To write statements that input data from the keyboard and output data to the screen.To declare and use data of various types.To store and retrieve data from memory.To u

932 views • 86 slides

Visual Basic: Introduction

Visual Basic: Introduction

CIS 115 Lecture 2. Visual Basic: Introduction. Software to Install . Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available from MSDNAA. Visual Studio.NET.

832 views • 41 slides

Introduction to Visual Basic

Introduction to Visual Basic. Presented by Charley Jones The Maxim Group Las Vegas, NV [email protected] All code samples will be posted to: http://www.crjones.com/vbintro. Introduction to Visual Basic. Integrated Development Environment Compiler Optimizer Debugger Demonstration:

233 views • 8 slides

An Introduction to Visual Basic 2005

An Introduction to Visual Basic 2005

An Introduction to Visual Basic 2005. Objectives. Explain the history of programming languages Define the terminology used in object-oriented programming Explain the role of the .NET Framework class library and Common Language Runtime (CLR) Create a Visual Basic 2005 Windows-based application

913 views • 72 slides

Introduction to Visual Basic

Introduction to Visual Basic. Chulantha Kulasekere. VB IDE. Explanation of IDE. Project: A collection of files for easy management. Standard.EXE: Should be used if the file is an executable. It will open a blank form to write your application. VB Environment. Creating Your First Program.

260 views • 11 slides

Visual Basic Introduction

Visual Basic Introduction. IDS 306 from Shelly, Cashman & Repede Microsoft Visual Basic 5: Complete Concepts and Techniques. Processing. Parallel Processing -- more than one CPU (each with its own memory); able to carry out more than one instruction at a time

369 views • 23 slides

Visual Basic Introduction

Visual Basic Introduction. Rosalind Archer. Running Visual Basic. Visual Basic is included with Microsoft Excel. My examples use Excel ‘97. When you open a file containing Visual Basic code make sure you choose “Enable Macros”. Your message may look a little different to this one.

831 views • 49 slides

Introduction to Visual Basic

Introduction to Visual Basic. Event-driven programming The interface for a VB program consists of one or more forms, containing one or more controls (screen objects).

753 views • 47 slides

Introduction to Visual Basic (VB)

Introduction to Visual Basic (VB)

Introduction to Visual Basic (VB). Topics. 1. What is VB? 2. What is Event-Driven? 3. What is Object-Orientation? 4. Objects used in VB 5. VB objects naming practice 6. Files in VB 7. OOED Programming process 8. VB statements 9. VB Help. What is VB?.

404 views • 28 slides

Introduction to Visual Basic

Introduction to Visual Basic. What is Visual Basic?. An environment for developing Windows applications Components A GUI (Graphical User Interface - gooey) designer Tools (command buttons, list boxes, text boxes, option buttons, etc.) A programming language Qbasic like

490 views • 12 slides

An Introduction to Visual Basic

An Introduction to Visual Basic. Terms & Concepts. What is VB?. Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows. VB has been developed through many versions. This course uses VB 2005. Getting Started.

297 views • 8 slides

Chapter 1: An Introduction to Visual Basic 2012

Chapter 1: An Introduction to Visual Basic 2012

Chapter 1: An Introduction to Visual Basic 2012. Lesson A Objectives. After studying Lesson A, you should be able to: Start and customize Visual Studio 2012 Create a Visual Basic 2012 Windows application Manage the windows in the IDE Set the properties of an object

644 views • 53 slides

An Introduction to Visual Basic 2005

An Introduction to Visual Basic 2005. Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual Basic. Programmer and User. Programmer – the person who solves the problem and writes the instructions for the computer

357 views • 13 slides

Introduction to Visual Basic

Introduction to Visual Basic. Visual - A method used to create GUI applications. BASIC - B eginner’s A ll - purpose S ymbolic I nstruction C ode developed by John Kemeny. VB- Evolved from BASIC language. Developed by Microsoft Corporation in 1990s. Visual Basic Concepts.

648 views • 8 slides

Introduction to Visual Basic

Introduction to Visual Basic. laura leventhal and lisa weihl. Dinosaurs?. The COBOL Programmer

566 views • 39 slides

Visual Basic: Introduction

CIS 115 Lecture 2. Visual Basic: Introduction. Software to Install. Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available from MSDNAA. Visual Studio.NET.

655 views • 41 slides

Tutorial 1 An Introduction to Visual Basic .NET

Tutorial 1 An Introduction to Visual Basic .NET

Tutorial 1 An Introduction to Visual Basic .NET. Creating a Windows-Based Application in Visual Basic .NET Lesson A. Lesson A Objectives. After completing this lesson, you will be able to: Start and customize Visual Studio .NET Create a Visual Studio .NET solution and project

259 views • 12 slides

visual basic powerpoint presentation

Basic tasks for creating a PowerPoint presentation

PowerPoint presentations work like slide shows. To convey a message or a story, you break it down into slides. Think of each slide as a blank canvas for the pictures and words that help you tell your story.

Choose a theme

When you open PowerPoint, you’ll see some built-in themes and templates . A theme is a slide design that contains matching colors, fonts, and special effects like shadows, reflections, and more.

On the File tab of the Ribbon, select New , and then choose a theme.

PowerPoint shows you a preview of the theme, with four color variations to choose from on the right side.

Click Create , or pick a color variation and then click Create .

Shows the Create New presentation from Theme dialog in PowerPoint

Read more: Use or create themes in PowerPoint

Insert a new slide

On the Home tab, click the bottom half of  New Slide , and pick a slide layout.

Shows New Slide button on Home tab of the ribbon in PowerPoint

Read more: Add, rearrange, and delete slides .

Save your presentation

On the File tab, choose Save .

Pick or browse to a folder.

In the File name box, type a name for your presentation, and then choose Save .

Note:  If you frequently save files to a certain folder, you can ‘pin’ the path so that it is always available (as shown below).

Save your PowerPoint presentation

Tip:  Save your work as you go. Press Ctrl+S often or save the file to OneDrive and let AutoSave take care of it for you. 

Read more: Save your presentation file

Select a text placeholder, and begin typing.

Shows adding text to a text field in PowerPoint

Format your text

Select the text.

Under Drawing Tools , choose Format .

Shows the Drawing Tools tab on the ribbon in PowerPoint

Do one of the following:

To change the color of your text, choose Text Fill , and then choose a color.

To change the outline color of your text, choose Text Outline , and then choose a color.

To apply a shadow, reflection, glow, bevel, 3-D rotation, a transform, choose Text Effects , and then choose the effect you want.

Change the fonts

Change the color of text on a slide

Add bullets or numbers to text

Format text as superscript or subscript

Add pictures

On the Insert tab, select Pictures , then do one of the following:

To insert a picture that is saved on your local drive or an internal server, choose This Device , browse for the picture, and then choose Insert .

(For Microsoft 365 subscribers) To insert a picture from our library, choose Stock Images , browse for a picture, select it and choose Insert .

To insert a picture from the web, choose Online Pictures , and use the search box to find a picture. Choose a picture, and then click Insert .

Insert image location in the ribbon.

You can add shapes to illustrate your slide. 

On the Insert tab, select Shapes , and then select a shape from the menu that appears.

In the slide area, click and drag to draw the shape.

Select the Format or Shape Format tab on the ribbon. Open the Shape Styles gallery to quickly add a color and style (including shading) to the selected shape.

Shape Styles group

Add speaker notes

Slides are best when you don’t cram in too much information. You can put helpful facts and notes in the speaker notes, and refer to them as you present.

notes button in PowerPoint

Click inside the Notes pane below the slide, and begin typing your notes.

Shows the speaker Notes pane in PowerPoint

Add speaker notes to your slides

Print slides with or without speaker notes

Give your presentation

On the Slide Show tab, do one of the following:

To start the presentation at the first slide, in the Start Slide Show group, click From Beginning .

Shows the Slide Show tab on the ribbon in PowerPoint

If you’re not at the first slide and want to start from where you are, click From Current Slide .

If you need to present to people who are not where you are, click Present Online to set up a presentation on the web, and then choose one of the following options:

Broadcast your PowerPoint presentation online to a remote audience

View your speaker notes as you deliver your slide show.

Get out of Slide Show view

To get out of Slide Show view at any time, on the keyboard, press Esc .

You can quickly apply a theme when you're starting a new presentation:

On the File tab, click New .

Select a theme.

Apply a theme

Read more:  Apply a design theme to your presentation

In the slide thumbnail pane on the left, select the slide that you want your new slide to follow.

On the Home tab, select the lower half of  New Slide .

From the menu, select the layout that you want for your new slide.

Your new slide is inserted, and you can click inside a placeholder to begin adding content.

Learn more about slide layouts

Read more: Add, rearrange, and delete slides

PowerPoint for the web automatically saves your work to your OneDrive, in the cloud.

To change the name of the automatically saved file:

In the title bar, click the file name.

In the File Name box, enter the name you want to apply to the file.

If you want to change the cloud storage location, at the right end of the Location box, click the arrow symbol, then navigate to the folder you want, then select Move here .

On the Home tab, use the Font options:

Font color button in Visio for the web

Select from other formatting options such as Bold , Italic , Underline , Strikethrough , Subscript , and Superscript .

On the  Insert  tab, select  Pictures .

From the menu, select where you want to insert the picture from:

On the Insert tab of the ribbon, select Pictures, and then on the menu choose the type of picture you want.

Browse to the image you want, select it, then select Insert . 

After the image is inserted on the slide, you can select it and drag to reposition it, and you can select and drag a corner handle to resize the image. 

On the slide canvas, click and drag to draw the shape.

Select the Shape tab on the ribbon. Open the Shape Styles gallery to quickly add a color and style (including shading) to the selected shape.

The Shape tab on the ribbon in PowerPoint for the web includes quick styles you can apply to any shape.

A horizontal Notes pane appears at the bottom of the window, below the slide.

Click in the pane, then enter text. 

Vertical double arrow

On the  Slide Show  tab, select  Play From Beginning .

To start a slide show, on the View tab of the ribbon select Play From Beginning.

To navigate through the slides, simply click the mouse or press the spacebar.

Tip:  You can also use the forward and back arrow keys on your keyboard to navigate through the slide show.

Read more:  Present your slide show

Stop a slide show

To get out of Slide Show view at any time, on the keyboard, press Esc.

The full-screen slide show will close, and you will be returned to the editing view of the file.

Tips for creating an effective presentation

Consider the following tips to keep your audience interested.

Minimize the number of slides

To maintain a clear message and to keep your audience attentive and interested, keep the number of slides in your presentation to a minimum.

Choose an audience-friendly font size

The audience must be able to read your slides from a distance. Generally speaking, a font size smaller than 30 might be too difficult for the audience to see.

Keep your slide text simple

You want your audience to listen to you present your information, instead of reading the screen. Use bullets or short sentences, and try to keep each item to one line.

Some projectors crop slides at the edges, so that long sentences might be cropped.

Use visuals to help express your message

Pictures, charts, graphs, and SmartArt graphics provide visual cues for your audience to remember. Add meaningful art to complement the text and messaging on your slides.

As with text, however, avoid including too many visual aids on your slide.

Make labels for charts and graphs understandable

Use only enough text to make label elements in a chart or graph comprehensible.

Apply subtle, consistent slide backgrounds

Choose an appealing, consistent template or theme that is not too eye-catching. You don't want the background or design to detract from your message.

However, you also want to provide a contrast between the background color and text color. The built-in themes in PowerPoint set the contrast between a light background with dark colored text or dark background with light colored text.

For more information about how to use themes, see Apply a theme to add color and style to your presentation .

Check the spelling and grammar

To earn and maintain the respect of your audience, always check the spelling and grammar in your presentation .

Top of Page

Facebook

Need more help?

Want more options.

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

visual basic powerpoint presentation

Microsoft 365 subscription benefits

visual basic powerpoint presentation

Microsoft 365 training

visual basic powerpoint presentation

Microsoft security

visual basic powerpoint presentation

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

visual basic powerpoint presentation

Ask the Microsoft Community

visual basic powerpoint presentation

Microsoft Tech Community

visual basic powerpoint presentation

Windows Insiders

Microsoft 365 Insiders

Was this information helpful?

Thank you for your feedback.

IMAGES

  1. Visual Basic in Powerpoint

    visual basic powerpoint presentation

  2. How to use some tools of Visual Basic in PowerPoint.

    visual basic powerpoint presentation

  3. PPT

    visual basic powerpoint presentation

  4. PowerPoint Automation using VBA. Complete professional course for free

    visual basic powerpoint presentation

  5. PPT

    visual basic powerpoint presentation

  6. How to use VBA in PowerPoint: A beginner's guide

    visual basic powerpoint presentation

VIDEO

  1. Basic Powerpoint tutorial for beginner!

  2. Image tools in PowerPoint

  3. Inserting Shapes in PowerPoint

  4. Drawing tools in PowerPoint

  5. Mini Point of Sales System VB6 Visual Basic Projects and Demos

  6. PowerPoint Lecture

COMMENTS

  1. How to use VBA in PowerPoint: A beginner's guide

    With PowerPoint open and at least one presentation file open, press Alt+F11* on your keyboard. This will open the VBE (Visual Basic Editor): *If for some reason Alt+F11 isn't mapped on your keyboard you can right click anywhere on the ribbon, select Customize the Ribbon… and in the window that appears, tick the Developer Tab check box over ...

  2. PowerPoint Visual Basic for Applications (VBA) reference

    This reference contains conceptual overviews, programming tasks, samples, and references to guide you in developing solutions based on PowerPoint. Note. Interested in developing solutions that extend the Office experience across multiple platforms? Check out the new Office Add-ins model. Use the table of contents in the navigation on the left ...

  3. How to Open and Use VBA Macro Editor in PowerPoint

    Steps to open the VBA macro editor. 1. Create a new presentation or open an existing one. Then go to the File tab and click on Options. 2. Click on Customize Ribbon, and check the box next to Developer and click OK. 3. Go to the Developer tab and click on Visual Basic. Another way is to press Alt + F11 on your keyboard.

  4. PowerPoint VBA Macro Examples & Tutorial

    When VBA code is running within a PowerPoint Presentation, PowerPoint Application is the default application and it can be manipulated without explicitly reference. Create a New Presentation ... Open the VBA Editor (ALT + F11 or Developer > Visual Basic) 2. Go to Insert > Module to create a Code Module 3.

  5. VBA Tutorial to Create Powerpoint Presentation

    Step 8: We need to add a presentation to the PowerPoint app we have launched. Code: Set PPPresentation = PPApp.Presentations.Add. Now, we should see the PowerPoint presentation like this. Step 9: We need to add a slide after adding the presentation. Code: Set PPSlide = PPPresentation.Slides.Add(1, ppLayoutTitleOnly)

  6. 2. Introducing Visual Basic for Applications

    Visual Basic for Applications (VBA) is a very powerful object-oriented programming language that can be used to add to the functionality of Microsoft Office applications, including PowerPoint. Originally, PowerPoint was a presentation tool, used by many to enhance lectures, sometimes making them better and sometimes making them worse.

  7. Create a macro in PowerPoint

    Create or edit a macro. To create or edit a macro by using Visual Basic for Applications, do the following: On the View tab, choose Macros. In the Macro dialog box, type a name for the macro. In the Macro in list, click the template or the presentation that you want to store the macro in. In the Description box, type a description for the macro.

  8. Slides.AddSlide method (PowerPoint)

    It adds a new slide in index position 2 that has the same layout as the first slide in the active presentation. ... If your Visual Studio solution includes the Microsoft.Office.Interop.PowerPoint reference, this method maps to the following types: Microsoft.Office.Interop.PowerPoint.Slides.Add(int, Microsoft.Office.Interop.PowerPoint ...

  9. Run a macro in PowerPoint

    To run a macro in PowerPoint, the Developer tab must be visible on the ribbon. See Show the Developer tab. With the Developer tab visible: On the Developer tab, in the Code group, click Macros. In the Macro dialog box, under Macro name, select the macro that you want, and then click Run. For information about the security risks of macros and ...

  10. 3. Getting Started with VBA

    Accessing the VBA Editor. Once you start a PowerPoint project, you get into VBA by holding down the ALT key and hitting the F11 key (Option-F11 on a MacOS). Alternatively, go to the Developer tab of the Ribbon and click on Visual Basic. If you don't have the Developer tab, go back to blog#1 to review how to get it.

  11. PowerPoint object model for Visual Basic for Applications (VBA)

    This section of the PowerPoint VBA Reference contains documentation for all the objects, properties, methods, and events contained in the PowerPoint object model. Use the table of contents in the left navigation to view the topics in this section. Note. Interested in developing solutions that extend the Office experience across multiple ...

  12. Find Help on using the Visual Basic Editor

    Microsoft Visual Basic for Applications (VBA) enables non-programmers to record, create, and edit macros that can automate tasks in Office applications. ... In the browser, on the left pane, under PowerPoint, expand the PowerPoint VBA reference. In the left pane, browse to find the concept, procedure, or object that you want help with, or type ...

  13. 1.PowerPoint VBA Series

    PowerPoint VBA Series, What is VBA, VBA Tutorial, Visual Basic, Office 365Hello.!All my videos are purely focused on Creating Powerpoint Presentation templat...

  14. Table object (PowerPoint)

    Use the HasTable property to see if a shape contains a table. This example walks through the shapes on slide one, checks to see if each shape has a table, and then sets the mouse click action for each table shape to advance to the next slide. VB. Copy. With ActivePresentation.Slides(2).Shapes. For i = 1 To .Count. If .Item(i).HasTable Then.

  15. Easily create a quiz in PowerPoint using Visual Basic for Applications

    Step 2: Create macros. When the Q & A slides are done, you're ready to create the macros using PowerPoint's Visual Basic Editor. Before you begin, make sure that only the presentation you are currently working on is open. To open the Visual Basic Editor, choose Tools> Macro> Visual Basic Editor. In 2007 and later, you first need to display ...

  16. Save a presentation that contains VBA macros

    To save a presentation that contains VBA macros, do the following: Click the File tab, and then click Save As. In the Save as type list, select one of the following: PowerPoint Macro-Enabled Presentation A presentation with a .pptm file name extension that can contain VBA code. PowerPoint Macro-Enabled Show A show with a .ppsm file name ...

  17. Is it possible to jump to a specific PowerPoint slide using VBA?

    Here is some code to rename the current slide. Sub ChangeSlideName() Dim NewName As String. Dim ActiveSlide As Slide. Set ActiveSlide = ActiveWindow.View.Slide. NewName = InputBox("Enter new slide name for slide " & _. ActiveSlide.SlideIndex, "New Slide Name", ActiveSlide.Name) If NewName = "" Then.

  18. introduction to visual basic PPT.pptx

    Visual basic ppt for tutorials computer. Introduction to Visual Basic. visual basic v6 introduction. Visual basic 6.0. Ch 3 event driven programming. Windows 7, 8, 8.1 & 10. Windows operating system. Architecture of .net framework. Introduction to c#.

  19. Presentations.Open method (PowerPoint)

    Opens the file with read/write status. Opens the file with read-only status. The Untitled parameter value can be one of these MsoTriState constants. The default. The file name automatically becomes the title of the opened presentation. Opens the file without a title. This is equivalent to creating a copy of the file.

  20. PPT

    Visual Basic is a programming language (actually an environment) designed to create computer programs that run in Microsoft Windows. VB has been developed through many versions. This course uses VB 6.0. Getting Started. Download Presentation. window. visual basic. basic code. programming language.

  21. Basic tasks for creating a PowerPoint presentation

    Select the text. Under Drawing Tools, choose Format. Do one of the following: To change the color of your text, choose Text Fill, and then choose a color. To change the outline color of your text, choose Text Outline, and then choose a color. To apply a shadow, reflection, glow, bevel, 3-D rotation, a transform, choose Text Effects, and then ...

  22. Slides object (PowerPoint)

    Use the Slides property to return a Slides collection. Use the Add method to create a new slide and add it to the collection. The following example adds a new slide to the active presentation. VB. Copy. ActivePresentation.Slides.Add 2, ppLayoutBlank. Use Slides ( index ), where index is the slide name or index number, or use the Slides ...

  23. Visual basic

    17. Opening , Saving & Running 17 Opening a Project : - To open a VB project , invoke VB6 shortcut on the Desktop or going through the pull-up menu select VB program . Start Program Microsoft Visual Basic 6.0 . Saving a Project : - After creating a Project , user need to save it . For this click File menu and select save project.