VBA in PowerPoint : Plus Value from TextBox (ActiveXControl)

43 views Asked by At

All shapes from slides 1 As so see, I wanna add the number from the UP1 textbox (The one shown "10")(ActiveXControl so it can be edited while presenting) to the S1 Textbox (Shown "10") Here is my code:

Slide1.Shapes("S1").TextFrame.TextRange = Slide1.Shapes("S1").TextFrame.TextRange + UP1

But here is my result: After Running

1

There are 1 answers

0
TinMan On

String values should be cast into numeric values before adding them.

With Slide1.Shapes("S1").TextFrame.TextRange
    .Text = Val(.Text) + UP1
End With