M
MichaelB1969
Would very much appreciate some advice here. I am trying to embed an ROI
calculator within a PPT so that when a presenter is giving the presentation,
they can enter values along the way and have it spit out an ROI calculation
at the end.
I am just testing a basic L * W = A formula now. It works when everything
is on one slide. However, when I move the calculate button and the text box
containing the answer to the second slide, I need to change the code so that
it references the values in the text boxes in Slide 1, and that is what isn't
working.
So...
In slide 1, I have two text boxes that I created from the control toolbox.
They are:
TextBox1
TextBox2
In slide 2, I have one text box for the answer, and a calculate button,
labeled:
TextBox3
Calculate
My VBA, which is written for slide 2, looks like this:
Private Sub Calculate_Click()
Dim L As Single
Dim W As Single
Dim A As Single
L = ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text
W = ActivePresentation.Slides(1).Shapes(2).TextFrame.TextRange.Text
A = L * W
TextBox3.Text = A
End Sub
It doesn't work, and I have tried multiple things. Anyone have any ideas?
When I debug, it doesn't like the line beginning with L=, so I assume it
can't reference the object in the first slide.
Thanks,
Mike
calculator within a PPT so that when a presenter is giving the presentation,
they can enter values along the way and have it spit out an ROI calculation
at the end.
I am just testing a basic L * W = A formula now. It works when everything
is on one slide. However, when I move the calculate button and the text box
containing the answer to the second slide, I need to change the code so that
it references the values in the text boxes in Slide 1, and that is what isn't
working.
So...
In slide 1, I have two text boxes that I created from the control toolbox.
They are:
TextBox1
TextBox2
In slide 2, I have one text box for the answer, and a calculate button,
labeled:
TextBox3
Calculate
My VBA, which is written for slide 2, looks like this:
Private Sub Calculate_Click()
Dim L As Single
Dim W As Single
Dim A As Single
L = ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text
W = ActivePresentation.Slides(1).Shapes(2).TextFrame.TextRange.Text
A = L * W
TextBox3.Text = A
End Sub
It doesn't work, and I have tried multiple things. Anyone have any ideas?
When I debug, it doesn't like the line beginning with L=, so I assume it
can't reference the object in the first slide.
Thanks,
Mike