Share via

Display Variable in PPT Text Box

Anonymous
2012-12-12T02:10:27+00:00

Greetings,

I am new to the VBA game but am trying to create an on screen number value that updates when certain triggers are pulled.

I already have the back end working with the variables and macros, but my question is:

"How do I get the variables to display on screen in a text box or something similar" . I do not want to use a pop up MsgBox, altho that's what I've been using to test it and make sure things on the back end are working.

Thanks

Fox

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-12-12T13:57:57+00:00

In Steve's example, change "Your Text Here" to RoundScore as in

With ActivePresentation.Slides(2).Shapes("Rectangle1")

.TextFrame.TextRange.Text = RoundScore

End With

or something like this

With ActivePresentation.Slides(2).Shapes("Rectangle1")

.TextFrame.TextRange.Text = "The score is" & RoundScore & ". Have a nice day."

End With

David Marcovitz

Author of Powerful PowerPoint for Educators

http://www.PowerfulPowerPoint.com/

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Steve Rindsberg 99,166 Reputation points MVP Volunteer Moderator
2012-12-12T02:46:39+00:00

Suppose you have a shape on the slide ... any shape will do, so long as it can contain text.

Let's assume it's slide 2 and the shape's name is Rectangle1

VBA:

With ActivePresentation.Slides(2).Shapes("Rectangle1")

.TextFrame.TextRange.Text = "Your Text Here"

End With

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-12-12T03:43:54+00:00

    OK. Next finding. I was able to get the text to display on the screen but it was just the " & RoundScore & " printed verbatim.

    How would I go about getting it to display the variable integer I have stored in RoundScore?

    Thanks again!

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more