I am trying to create a macro in powerpoint to automate some regular tasks. So, I have a master powerpoint that has ~60 odd slides. I want to create a macro that will go through the entire deck and copy specific slides that have certain text in them. I can create an array with the key words that form the basis of the selection but cannot figure out how to copy the entire slide. Below code is the result of some foraging on the internet.
Sub selct()
Dim i As Long, n As Long
Dim TargetList
'~~> Array of terms to search for
TargetList = Array("Agenda", "Review", "third", "etc")
'~~> Loop through each slide
For Each sld In Application.ActivePresentation.Slides
'~~> Loop through each shape
For Each shp In sld.Shapes
'~~> Check if it has text
If shp.HasTextFrame Then
Set txtRng = shp.TextFrame.TextRange
For i = 0 To UBound(TargetList)
'~~> Find the text
Set rngFound = txtRng.Find(TargetList(i))
I'm not sure how to select the specific slides and copy them.
Any help will be much appreciated!
Thanks
S
Sub selct()
Dim i As Long, n As Long
Dim TargetList
'~~> Array of terms to search for
TargetList = Array("Agenda", "Review", "third", "etc")
'~~> Loop through each slide
For Each sld In Application.ActivePresentation.Slides
'~~> Loop through each shape
For Each shp In sld.Shapes
'~~> Check if it has text
If shp.HasTextFrame Then
Set txtRng = shp.TextFrame.TextRange
For i = 0 To UBound(TargetList)
'~~> Find the text
Set rngFound = txtRng.Find(TargetList(i))
I'm not sure how to select the specific slides and copy them.
Any help will be much appreciated!
Thanks
S
Last edited: