Hello From Steve
Word will not stop and the end of document
What is required please for this to happen
Sub Jockeys_and_Trainers_to_Charts()
Application.ScreenUpdating = False
Do
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 12
With Selection.Find
.Text = "|"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
If Selection.Find.found Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.HomeKey
With Selection.Find
.Text = "[0-9]{1,}*[A-Z]{1,}?"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Fields.Update
strText = Selection.Text
Selection.Collapse Direction:=wdCollapseStart
Selection.MoveRight Unit:=wdCharacter, Count:=1
With Selection.Find
.Forward = False
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.Text = strText
.MatchWildcards = True
.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[-0-9]{1,} [A-Z]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = terue
.MatchCase = True
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Extend
With Selection.Find
.Text = "[A-Z] [A-Z]{1,}"
.Replacement.Text = ""
.Forward = False
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.HomeKey
With Selection.Find
.Text = "[0-9]{1,} [A-Z]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Fields.Update
strText = Selection.Text
Selection.Collapse Direction:=wdCollapseStart
Selection.MoveDown Unit:=wdLine, Count:=2
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.Text = strText
.MatchWildcards = False
.Execute
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "|"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Paste
End With
Selection.TypeText Text:=vbTab
Selection.HomeKey
With Selection.Find
.Text = "[0-9]{1,} [A-Z]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Fields.Update
strText = Selection.Text
Selection.Collapse Direction:=wdCollapseStart
Selection.MoveRight Unit:=wdCharacter, Count:=1
With Selection.Find
.Forward = False
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.Text = strText
.MatchWildcards = False
.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.HomeKey
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 10.5
With Selection.Find
.Text = "[A-Z]-[A-Z]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=2
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
.Text = "[A-Z]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Extend
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.HomeKey
With Selection.Find
.Text = " [0-9]{1,} [A-Z]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Fields.Update
strText = Selection.Text
Selection.Collapse Direction:=wdCollapseStart
Selection.MoveRight Unit:=wdCharacter, Count:=1
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.MatchCase = True
.MatchWholeWord = True
.Text = strText
.MatchWildcards = False
.Execute
End With
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "|"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Paste
Selection.HomeKey
Selection.MoveDown Unit:=wdLine, Count:=1
End If
Loop While Selection.Find.found
Application.ScreenUpdating = True
```End Sub