with this line goto .Text = "Race" and :

  • Thread starter Thread starter Steved
  • Start date Start date
S

Steved

Hello from steved

My Objective is to find the word "Race" and find the last paragraph.
I then us autotext to insert a border with "Win"

What is happening it might find 10 race for example.

ok how can I find using the below to find ":"
for example '1:" or "12:" not 1 Race or 10 Race please.

Yes look for ":" "Race"

12:55 Race or 1:25 Race


Sub RaceTemplate()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Race"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection.Find
.Text = "^12"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.MoveUp Unit:=wdLine, count:=2
Selection.TypeText Text:="win"
Selection.Range.InsertAutoText
End Sub

Thankyou.
 
Hello from Steved

My attempt below

Sub RaceTemplate()
Selection.Find.ClearFormatting
With Selection.Find
.Text = ":"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Race"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection.Find
.Text = "^12"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.MoveUp Unit:=wdLine, count:=2
Selection.TypeText Text:="win"
Selection.Range.InsertAutoText
End Sub
 
Back
Top