eHow launches Android app: Get the best of eHow on the go.

How To

How to Write in Visual Basic in Power Point

Contributor
By Tricia Goss
eHow Contributing Writer
(0 Ratings)

Visual Basic is a language used by Windows applications. VBA, which is Visual Basic for Applications, can be used in Windows programs such as PowerPoint and other Office applications. Working with VBA allows the user to create macros, which are shortcuts to tasks that you want to perform on a regular basis. Macros can be very simple or exceedingly complex. It all depends on what you require and how knowledgeable you are in Visual Basic.

Difficulty: Moderately Easy
Instructions

Things You'll Need:

  • PowerPoint version 2000 to 2007
  1. 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."

  2. 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.

  3. Step 3
     

    Go to the "Insert" menu and select "Module." A blank page will open. This is where the VBA code will be entered.

  4. 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.

  5. 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.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Computers Newsletters

Copyright © 1999-2010 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

eHow Computers
eHow_eHow Technology and Electronics