PDA

View Full Version : Powerpoint scoreboard VBA help!



ChrisAtraen
03-11-2015, 10:50 PM
Hi there, I'm currently working on making a game for one of my schools and I can't quite get the VBA working. I took the code out of another powerpoint, which although works fine in the other powerpoint, I am having trouble getting it to function in this one.

Here is a screen shot of the scoreboard:12990
When I click the upwards arrow I want it to increase 'OdaAtt' (the selected box) by 1 point. Likewise when I hit the down arrow I want the score to decrease by one.

The code I am using is as follows:

Option Explicit
Dim scoreOdaAtt As Long

Sub Add1OdaAtt()
scoreOdaAtt = scoreOdaAtt + 1
UpdateScores
End Sub
Sub Minus1OdaAtt()
scoreOdaAtt = scoreOdaAtt - 1
UpdateScores
End Sub

Sub UpdateScores()
ActivePresentation.Slides("Slide7").Shapes("OdaAtt").TextFrame.TextRange.Text = scoreOdaAtt
End Sub



I would really appreciate any help anyone can offer!!
Thanks in advance!