Janie
This code will find the first instance of "xyz" on a selected slide
Sub findit()
Dim oshp As Shape
On Error GoTo err
If ActiveWindow.Selection.SlideRange.Count <> 1 Then Exit Sub
For Each oshp In ActiveWindow.Selection.SlideRange.Shapes
If oshp.HasTextFrame Then
If oshp.TextFrame.TextRange = "xyz" Then
oshp.Select
Exit Sub ' remove this line to select last
End If
End If
Next oshp
Exit Sub
err:
MsgBox "There's an error, maybe you didn't select anything"
End Sub
Remove the line exit sub indicated and it would find the last instance
Need some vba hints - have a look at my site http://www.PPTAlchemy.co.uk

Signature
--------------------------------------------
Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk/ppttipshome.html
email john AT technologytrish.co.uk
> A) I really do want to select it
> B) I do not need to search an entire presentation, just a given slide
[quoted text clipped - 34 lines]
> > >
> > > Many thankx
Steve Rindsberg - 15 Feb 2007 03:21 GMT
Hey John,
I'll see your FindIt and raise you one. This is missing the cautionary code
but it does find and select the requested text within a text box. I think
yours will only work if the entire contents of the text box matches the search
string.
Sub FinditBetter(sSearchString As String)
Dim oSh As Shape
Dim oRng As TextRange
For Each oSh In ActiveWindow.Selection.SlideRange.Shapes
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
' is the search string found in this text box?
If InStr(oSh.TextFrame.TextRange.Text, _
sSearchString) > 0 Then
' where in the text box?
' WATCH OUT FOR LINE BREAKS; THIS IS ALL ON ONE LINE:
Set oRng =
oSh.TextFrame.TextRange.Characters(InStr(oSh.TextFrame.TextRange.Text,
sSearchString), Len(sSearchString))
oRng.Select
End If
End If
End If
Next
End Sub
And to use it, you can type:
finditbetter "Def"
into the immediate box or get fancy and add an input box to the macro to get
the text to search for.
Not perfect ... it can be thrown off by linebreaks in textboxes, but still ...
not bad
> Sub findit()
> Dim oshp As Shape
[quoted text clipped - 13 lines]
> MsgBox "There's an error, maybe you didn't select anything"
> End Sub
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================