1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
Sub UpdateNoteDates() Dim sld As Slide Dim findStr As String Dim chgStr As String Dim mvLen As Integer Dim inFind As String Dim searchSTring As String Dim txtRange As TextRange Dim shp As Shape inFind = InputBox("Enter M/D here to change") mvLen = Len(inFind) findStr = "Updated: " & inFind chgStr = InputBox("Input M/D") ActiveWindow.ViewType = ppViewNotesPage For Each sld In ActivePresentation.Slides ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Find(findStr).Characters(Start:=10, Length:=mvLen).Select With ActiveWindow.Selection.TextRange .Text = chgStr End With Next ActiveWindow.ViewType = ppViewNormal End Sub
Hi,
try using a variable for the Find, then test for success by testing for the variable Not being Nothing
somethling like this
Cheers
Dave
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
Sub UpdateNoteDates() Dim sld As Slide Dim findStr As String Dim chgStr As String Dim mvLen As Integer Dim inFind As String Dim searchSTring As String Dim txtRange As TextRange Dim shp As Shape inFind = InputBox("Enter M/D here to change") mvLen = Len(inFind) findStr = "Updated: " & inFind chgStr = InputBox("Input M/D") Dim Fnd ActiveWindow.ViewType = ppViewNotesPage For Each sld In ActivePresentation.Slides ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select Set Fnd = ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Find(findStr) If Not Fnd Is Nothing Then With Fnd.Characters(Start:=10, Length:=mvLen) .Text = chgStr End With End With Next ActiveWindow.ViewType = ppViewNormal End Sub