Code: Select all
Sub TestMe()
Dim oSl As Slide: Set oSl = FindSlideByTitle("WORSHIP SERVICE")
If Not oSl Is Nothing Then MsgBox "Found your title on slide " & CStr(oSl.SlideIndex)
End Sub
Code: Select all
Function FindSlideByTitle(sTextToFind As String) As Slide
Dim oSl As Slide
For Each oSl In ActivePresentation.Slides
With oSl.Shapes.Title.TextFrame
On Error Resume Next
If .HasText Then
If UCase(.TextRange.Text) = UCase(sTextToFind) Then
Set FindSlideByTitle = oSl
End If
End If
End With
Next
End Function