A
Andy C Matthews
Hi there, hope someone can help.
I'm writing a simple Macro to copy the text in a cell (the result of a
formula) into a Text Box in a specific PowerPoint slide. What I have so far
is shown below (I have named the text box in Powerpoint 'textbox1'). I'm
struggling to find a way of pasting though!
Can anyone help?
Thanks,
Andy
UK
Sub macInsertStatsFigures()
'Jump to the Exit Criteria worksheet
Worksheets("Stats 11").Activate
Dim strFindText As String
Dim strReplaceText As String
strReplaceText = Range("P7")
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
'Select the correct slide in the Presentation
PPApp.ActivePresentation.Slides(4).Select
'Select Textbox1 in powerpoint
PPApp.ActiveWindow.Selection.SlideRange.Shapes("textbox1").Select
'Paste the contents of strReplaceText into it
End Sub
I'm writing a simple Macro to copy the text in a cell (the result of a
formula) into a Text Box in a specific PowerPoint slide. What I have so far
is shown below (I have named the text box in Powerpoint 'textbox1'). I'm
struggling to find a way of pasting though!
Can anyone help?
Thanks,
Andy
UK
Sub macInsertStatsFigures()
'Jump to the Exit Criteria worksheet
Worksheets("Stats 11").Activate
Dim strFindText As String
Dim strReplaceText As String
strReplaceText = Range("P7")
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
' Reference existing instance of PowerPoint
Set PPApp = GetObject(, "Powerpoint.Application")
' Reference active presentation
Set PPPres = PPApp.ActivePresentation
PPApp.ActiveWindow.ViewType = ppViewSlide
'Select the correct slide in the Presentation
PPApp.ActivePresentation.Slides(4).Select
'Select Textbox1 in powerpoint
PPApp.ActiveWindow.Selection.SlideRange.Shapes("textbox1").Select
'Paste the contents of strReplaceText into it
End Sub