Hello all, I'm new to programming with VBA and come from a background of simple codes in Python and HTML.
What I'm trying to do: Make a numeric variable that changes based on the choices (buttons) chosen.
Then, the value of the variable(s) determines the end slides. Also a way to dynamically display this variable would be great for testing.
I've been trying to wrap my head around this variable idea by using the info here: http://www.pptfaq.com/.
From my limited understanding, this variable will need to be global so that it can be changed at any point of the presentation. There might be multiple global variables that can change.
Also, the button that contains the trigger (what I know as "If-Else"), will also need to have some code in it that. An example is the button says "When this button is clicked, if variable1 >= 3, go to slide 3, else go to slide 5".
I've been able to get a variable using a modified version of the code found here: http://www.pptfaq.com/FAQ00583_Keep_Score_with_Static_Variables.htm
The example above uses a MsgBox to display the variable, which is a pop-up window that shows the text and score. I want the variable to only show as text for testing purposes, which I think I somewhat achieved using a shape named "TextBox" and mixing the code from the example:
Sub Example_Change() With ActivePresentation.Slides(5).Shapes("TextBox") .TextFrame.TextRange.Text = "Your score is now " & CStr(AddToScore(0)) End With End Sub
However, to get this to show the variable's number, the macro needs to be run inside of Visual Basic; I don't know how to execute the macro in a way that automatically updates the shape's text with this code. I also don't know how to change the value, as the increment code doesn't execute properly.
Any help with this would be greatly appreciated! Thanks in advance. :)