How to add a number during PPT?

D

DORI

Here is the scenario:
I want to interact with audience during the PPT. There are 2 variables
marked as A and B on all slides. I want to be able to increase the value of
A by 10 points by hitting a key (let say hitting F1) and increase the value
of B by 10 points by hitting a key (let say hitting F2). The numbers should
be updated when I move to the next slide, so that they represent the total
points.
Is this possible without using Excel?
Thanks for any help.
Dori
 
D

David M. Marcovitz

Something like this can be done with VBA. It's not Excel, but if you
haven't used VBA in PowerPoint, you might wish that it was.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
D

DORI

Hi Dave,
What VBA do you recommend?
Thanks,
Dori

David M. Marcovitz said:
Something like this can be done with VBA. It's not Excel, but if you
haven't used VBA in PowerPoint, you might wish that it was.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
D

DORI

Hi Steve,
Thanks for helping me out.
Let say on slide #1: I have a text box called "SCORE FOR GROUP A": The score
for Group A is zero to begin with. I want the score appear below the text box
of "SCORE FOR GROUP A". I want to have a dedicated action button for group A
so that every time that I click on it, it adds up 10 points to the score for
group A (i.e. A=A+10).
When I move to the next slide, I want to see the last score for group A from
previous slide and still be able to click the action button to add 10 points
to the score of group A until the show is over.
What VBA do you recommend.
Thank you,
Dori
 
D

David M. Marcovitz

Create a text box on a slide. Name it TheScoreBox (using the naming
procedure in Example 8.7 on my Web site). Create a button and link it to
the following procedure (this is all untested off the top of my head, but
it should get you started):

Dim theScore as Long

Sub IncreaseScore()
theScore = theScore + 10
ActivePresentation.Slides(2).Shapes("TheScoreBox") _
.TextFrame.TextRange.Text = theScore

End Sub

You might also want to have a procedure linked to a button on the first
slide:

Sub Initialize()
theScore = 0
ActivePresentation.Slides(2).Shapes("TheScoreBox") _
.TextFrame.TextRange.Text = theScore
End Sub

These procedures all assume that you have your score text box on slide 2.
If you want it to be a different slide, change the 2 (in Slides(2) ) to
another number. Also, if you want to have score boxes that have the same
score on other slides add identical lines in both procedures (that is,
repeat the two lines starting with ActivePresentation) and change the
number 2 to the numbers of the other slides that have score boxes (be
sure you also name those text boxes TheScoreBox.

Is this helpful? There are many examples that keep score on my Web site
(http://www.PowerfulPowerPoint.com/), but none of them do exactly what
you want. However, they might be helpful to get you to understand how
this all works.

--David


--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
D

DORI

Hi Steve,
Thank you so much for your help. I followed your instructions and it worked.
Can I apply the similar instructions to have a second score box totally
independent from the first score box on the same slides?
Thanks again,
Dori
PS. thanks to David too.
 
D

David M. Marcovitz

Yes, you just need another box with another name (such as
"TheOtherScoreBox"), and another variable with another name (such as
"theOtherScore"), and another procedure with another name (such as
"IncreaseOtherScore").
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top