Header
PowerPoint tips, hints and tutorials that will change your presentations for ever!

INDEX

 

Jigsaws
Sounds
Video
Custom Shows
vba code
NaviSlides
Games for teachers
Bullets
Triggers
Security
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Animation
Hyperlinks
Set spellcheck language


Home buttonTutorial buttonContact buttonProducts button


Starting to Write VBA

Lesson One

Learn how to open the VB editor, insert a module and write and run a simple subroutine.

First lets open the visual basic editor. This is where you write and edit your program.

Press ALT and f11 to open it,

vb editor

Your editor may look a little different .

Now from the VB Editor INSERT menu choose insert a mdule, this is where your first code will go.

Name and write the Subroutine

Type into the new module Sub MyFirstSub and press ENTER. PowerPoint will automatically add some code so it looks like this. For now you can ignore the brackets but do not delete them.

First sub!

You have created a sub called MyFirstSub! You can choose your own name but you cannot start with a number or use SPACES / | * - + or some other non letters. If you do the line will turn red to warn you. You code goes between the two lines. Type in the code below. It's boring but shows how to make the PC give a message.

First code!

Press f5 or choose Run > run sub/Userform to see what it does.

Make it run when a shape is clicked.

In PowerPoint you do NOT need to use command buttons to run code. Insert a circle or any other shape and give it an ACTION of run macro. Where this command is depends on the version of PowerPoint either INSERT tab or SlideShow menu.

Run the slide show (it won't work in edit mode) and click the button.

Congratulations your first code running in a slide show.

Slide show Code

 

Next Lesson Here

 
 

Back to the Index Page

POWERPOINT BLOG

Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation