I'm making a game inside PPT for cybersecurity awareness month for my company. I'm using VBA to make a couple of extra features that make it slightly nicer than just a jeopardy style quiz. I've already gotten buttons to work (action buttons) that can hide pictures / make them visible, as well as a button that can change the text on another slide (E.g button on slide 2 sets global variable to "boop" and then changes textbox on slide 1).
Right now i'm trying to figure out the code to do the same thing with a table made inside the slide. The table is already made (and renamed "testtable").
I want to select for example A2, and then make A2 = boop. I've tried a bunch of different code but can't figure out how to change the cell value.
Thanks for help
This code has worked perfectly to change text on a different slide
ActivePresentation.Slides(1).Shapes("textbox").TextFrame.TextRange.Text = randomInt
I've tried things like
ActivePresentation.Slides(3).Shapes("testtable").table.TextFrame.TextRange.Text = randomInt
I've tried changing the .text
to .value
. i've tried a bunch of other things but how card can it be to change a single cell?!
ActivePresentation.Slides(3).Shapes("testtable").Table.Cell(2, 1).Shape.TextFrame.TextRange.Text = randomInt
See the docs.
Thanks for the help. I've been looking through the docs and also StackExchange and still it hasn't been super easy (I way prefer Java...but I have to use PPT)