Bug

S

Steved

Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub
 
O

old man

Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
Steved said:
Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub
 
S

Steved

Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub



old man said:
Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
Steved said:
Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub
 
R

Russ

Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one line.
And where they are placed determines whether you are nesting if statements.

After you straighten that out, reread what the old man told you.


Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub



old man said:
Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
Steved said:
Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub
 
S

Steved

Hello Russ from Steved

I shall work throgh the issues you've given me and I'll see how I get on.

Thankyou.

Russ said:
Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one line.
And where they are placed determines whether you are nesting if statements.

After you straighten that out, reread what the old man told you.


Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub



old man said:
Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
:

Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
 
S

Steved

Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 30
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End Sub





Steved said:
Hello Russ from Steved

I shall work throgh the issues you've given me and I'll see how I get on.

Thankyou.

Russ said:
Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one line.
And where they are placed determines whether you are nesting if statements.

After you straighten that out, reread what the old man told you.


Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub



:

Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
:

Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
 
R

Russ

Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.
Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 30
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End Sub





Steved said:
Hello Russ from Steved

I shall work throgh the issues you've given me and I'll see how I get on.

Thankyou.

Russ said:
Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one line.
And where they are placed determines whether you are nesting if statements.

After you straighten that out, reread what the old man told you.



Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End
With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "L"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find.Font
.Size = 30
.Bold = True
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveUp Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End With
Next i
End Sub



:

Hi,

Are you trying to process each paragraph through a loop? Should you select
the paragraph after the for i statement?

maybe something like this:

ActiveDocument.Paragraphs(i).Range.Select

The wrap property of the find is set to "wdfindcontinue" which means that
it
(the find) will do the entire document, not just the selected range. Maybe
you want wdfindstop?

You may want to check the result of the find if a match was found for
whatever you were searching for with something like:

if selection.find.execute then

old man
:

Hello from Steved
The below macro will not run it stops on End With,What do I need to do
please to correct my problem. Thankyou.

End With
Next i
End Sub

Sub Testing2()
Dim i As Long, pararange As Range
For i = 1 To ActiveDocument.Paragraphs.Count
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
 
S

Steved

Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for Font
30 to start the next process so the below for example you see the numeral 2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.

2 98452 Gobi Hero

Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1

The Above is after running the Macro for the below.

1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st: Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st: Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston 1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun 2:16.57 3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st: Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88 1.4L
Racing well and building to a win. 2100m suits. Each way
-----------------------------------------------------------------------------------------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st: Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st: Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin 1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid 3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox 2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


Russ said:
Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.
Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 30
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End Sub





Steved said:
Hello Russ from Steved

I shall work throgh the issues you've given me and I'll see how I get on.

Thankyou.

:

Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one line.
And where they are placed determines whether you are nesting if statements.

After you straighten that out, reread what the old man told you.



Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End
With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
 
R

Russ

Steved,
In line reply below.
Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for Font
30 to start the next process so the below for example you see the numeral 2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.


2 98452 Gobi Hero
Is there a mix-up in your example?
The line above looks like data after 2, but the line below is data from 1?
So does data from 3 and 4 criss cross each other, too?
Isn't each number suppose to be a separate animal?
Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1


The Above is after running the Macro for the below.



1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st: Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st: Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston 1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun 2:16.57 3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st: Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88 1.4L
Racing well and building to a win. 2100m suits. Each way.
------------------------------------------------------------------------------
-----------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st: Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st: Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin 1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid 3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox 2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


Russ said:
Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.
Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[F] [0-9 ]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Extend
Selection.Find.ClearFormatting
Selection.Find.Font.Size = 30
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
End Sub





:

Hello Russ from Steved

I shall work throgh the issues you've given me and I'll see how I get on.

Thankyou.

:

Steved,

That error comes up if you are missing end ifs, too.
Your If statements all need an End If, if they span over more than one
line.
And where they are placed determines whether you are nesting if
statements.

After you straighten that out, reread what the old man told you.



Hello old man from Steved

Thankyou for taking timeout on my issue.

I am now having a Compile error "EndWith without with" it highlites End
With
at

End With
Next i
End Sub.

Could you please help me to get through the complie error. I thankyou

Sub Testing2()
Dim i As Long, pararange As Range
ActiveDocument.Paragraphs(i).Range.Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.Extend
Selection.HomeKey Unit:=wdLine
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
If Selection.Find.Execute Then
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
 
S

Steved

Hello Russ from Steved


The numbers start in order 1,2,3,4,5,6 and so on.

The example I showed was number 1 and 2 98452 Gobi Hero is the 2nd,
So now let me explain 2 98452 the number is always before a space that is
font 30 in this case "2" and in the below it is "3", " 4", "5"

3 43568
4 56009
5 66543

Ok the only way I know how to repeat the macro, is to find the next number
which has a Font Size 30, Each number with the size font 30 is at the start
of the new line to repeat the macro.

Hopefully that this has shown you what I am trying to do.

Thankyou.













Russ said:
Steved,
In line reply below.
Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for Font
30 to start the next process so the below for example you see the numeral 2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.


2 98452 Gobi Hero
Is there a mix-up in your example?
The line above looks like data after 2, but the line below is data from 1?
So does data from 3 and 4 criss cross each other, too?
Isn't each number suppose to be a separate animal?
Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1


The Above is after running the Macro for the below.



1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st: Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st: Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston 1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun 2:16.57 3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st: Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88 1.4L
Racing well and building to a win. 2100m suits. Each way.
------------------------------------------------------------------------------
-----------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st: Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st: Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin 1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid 3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox 2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


Russ said:
Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.

Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
 
R

Russ

You can try putting your code inside this piece of code:
Run it first, by itself to see if it selects what you want.

Dim aRange As Range
Dim aRange2 As Range
Set aRange = ActiveDocument.Content
With aRange.Find
.Format = True
.Font.Size = "30"
While .Execute = True
aRange2 = aRange.Duplicate


aRange2.select
'delete or comment out line below after testing
MsgBox "Check this out."

'Your code here:



Wend
End With
End Sub


Hello Russ from Steved


The numbers start in order 1,2,3,4,5,6 and so on.

The example I showed was number 1 and 2 98452 Gobi Hero is the 2nd,
So now let me explain 2 98452 the number is always before a space that is
font 30 in this case "2" and in the below it is "3", " 4", "5"

3 43568
4 56009
5 66543

Ok the only way I know how to repeat the macro, is to find the next number
which has a Font Size 30, Each number with the size font 30 is at the start
of the new line to repeat the macro.

Hopefully that this has shown you what I am trying to do.

Thankyou.













Russ said:
Steved,
In line reply below.
Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for Font
30 to start the next process so the below for example you see the numeral 2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when
the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.


2 98452 Gobi Hero
Is there a mix-up in your example?
The line above looks like data after 2, but the line below is data from 1?
So does data from 3 and 4 criss cross each other, too?
Isn't each number suppose to be a separate animal?
Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1


The Above is after running the Macro for the below.



1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st: Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st: Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston
1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun 2:16.57
3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st: Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88
1.4L
Racing well and building to a win. 2100m suits. Each way.
----------------------------------------------------------------------------
--
-----------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st: Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st: Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango
Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin 1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid 3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox 2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


:

Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.

Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the
last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:=", "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=", "
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Prz"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[L]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
 
S

Steved

Hello Rus from Steved

Yes that is exactly what I required.

Thankyou.

Russ said:
You can try putting your code inside this piece of code:
Run it first, by itself to see if it selects what you want.

Dim aRange As Range
Dim aRange2 As Range
Set aRange = ActiveDocument.Content
With aRange.Find
.Format = True
.Font.Size = "30"
While .Execute = True
aRange2 = aRange.Duplicate


aRange2.select
'delete or comment out line below after testing
MsgBox "Check this out."

'Your code here:



Wend
End With
End Sub


Hello Russ from Steved


The numbers start in order 1,2,3,4,5,6 and so on.

The example I showed was number 1 and 2 98452 Gobi Hero is the 2nd,
So now let me explain 2 98452 the number is always before a space that is
font 30 in this case "2" and in the below it is "3", " 4", "5"

3 43568
4 56009
5 66543

Ok the only way I know how to repeat the macro, is to find the next number
which has a Font Size 30, Each number with the size font 30 is at the start
of the new line to repeat the macro.

Hopefully that this has shown you what I am trying to do.

Thankyou.













Russ said:
Steved,
In line reply below.
Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for Font
30 to start the next process so the below for example you see the numeral 2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when
the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.



2 98452 Gobi Hero
Is there a mix-up in your example?
The line above looks like data after 2, but the line below is data from 1?
So does data from 3 and 4 criss cross each other, too?
Isn't each number suppose to be a separate animal?

Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1



The Above is after running the Macro for the below.




1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st: Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st: Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston
1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun 2:16.57
3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st: Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88
1.4L
Racing well and building to a win. 2100m suits. Each way.
----------------------------------------------------------------------------
--
-----------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st: Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st: Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango
Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin 1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid 3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox 2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


:

Explain what you want the macro to do.
Show an example of text before running the macro and show an example of how
you want the text to look like after running macro.

Hello from Steved

The below Macro runs as it should when I run it manually ("Icon Button"),
What do I need to do to it please to keep looping until the end off the
last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
 
R

Russ

Steved,
You¹re welcome. Good luck with your code.
Hello Rus from Steved

Yes that is exactly what I required.

Thankyou.

Russ said:
You can try putting your code inside this piece of code:
Run it first, by itself to see if it selects what you want.

Dim aRange As Range
Dim aRange2 As Range
Set aRange = ActiveDocument.Content
With aRange.Find
.Format = True
.Font.Size = "30"
While .Execute = True
aRange2 = aRange.Duplicate


aRange2.select
'delete or comment out line below after testing
MsgBox "Check this out."

'Your code here:



Wend
End With
End Sub


Hello Russ from Steved


The numbers start in order 1,2,3,4,5,6 and so on.

The example I showed was number 1 and 2 98452 Gobi Hero is the 2nd,
So now let me explain 2 98452 the number is always before a space that is
font 30 in this case "2" and in the below it is "3", " 4", "5"

3 43568
4 56009
5 66543

Ok the only way I know how to repeat the macro, is to find the next number
which has a Font Size 30, Each number with the size font 30 is at the start
of the new line to repeat the macro.

Hopefully that this has shown you what I am trying to do.

Thankyou.













:

Steved,
In line reply below.
Hello from Steved

The 1 of 1 x5433 Detention is size font 30 I ask the macro to look for
Font
30 to start the next process so the below for example you see the numeral
2
which is Font Size 30. All numbers start at the beginning and font 30 is
unique so this creates the starting point. Ive put in dashes to show when
the
macro starts the second process. I've got over 300 numbers . Thankyou once
again for looking at my request.



2 98452 Gobi Hero
Is there a mix-up in your example?
The line above looks like data after 2, but the line below is data from 1?
So does data from 3 and 4 criss cross each other, too?
Isn't each number suppose to be a separate animal?

Detention= by Triumphal March, $2,250, L 3:0:1, R 4:0:1



The Above is after running the Macro for the below.




1 x5433 Detention (14) 4g b Pupil (AUS)-Triumphal Queen (by Triumphal
March)
[Call It The Blues 7g(Blues Traveller), Coup Triumphal 5g(Prized), Lord
Pentire 8g(Pentire)]
Lisa Cropp 57kg (R57)
Light blue, black sleeves, red cap
Stats:
Trainer: Mike & Paul Moroney (Matamata)
Owner: G S Hale, A P Ramsden & M J Watkins
(B)
All 7:0:0:2:1
Prz $2,250
Win 0%
Plc 29%
SPR $321
Days 17
L 3:0:1
R 4:0:1
F 0:0:0
G 2:0:0
D 3:0:0
S 2:0:2
H 0:0:0
C 0:0:0
Dst 4:0:2
L12-W 0%
L12-P 29%
L12 est $2,250
F90 2:0:0:0
2Up 2:0:0:0
Fav 1:0:0:1
2 Fav 1:0:0:0
Perf:
AVON Trials 11 Apr 06 - - u/p of 8 MDN C/WGT 1050 S Chris Carmine 1st:
Cotes
Du Rhone 1:04.12
THAM Trials 11 May 06 - - u/p of 6 MDN QUAL 1200 H Chris Carmine 1st:
Manacourt 1:24.22
TETK Trials 05 Sep 06 - - u/p of 8 MDN QUAL 1200 S Jim Collett 1st:
Martini
Time 1:17.18
GISB (L) 21 Sep 06 - 1st up 5 of 14 Mdn $6K 1600 D- Bk inr,out 300,gd
fin,green late Michael Coleman [R50] 57 (8) 3/3 $7.75 1st: Charleston
1:38.70
3.9L
Stipes report: Raced greenly final stages
TARO (R) 18 Oct 06 27 dys 2nd up 6 of 13 Mdn $6K 2100 G2.3 Midf outr,hmprd
600,fin well outr Michael Coleman [R52] 57 (2) 3/3 $6.35 1st: Autun
2:16.57
3L
Stipes report: Had to be eased 600
DARG (L) 15 Nov 06 28 dys 3rd up 8 of 14 Mdn $6K 2000 G- Bk outr,made
ground
Paul Taylor [R51] 57 (13) 2/2 $4.00 1st: Scotnomates 2:06.73 4.8L
TAUR (R) 02 May 07 - 1st up 5 of 13 MdnHwt $6K 1600 S3.5 Rear outr,wd bk
tn,fair finish Michael Campbell [R50] 64.5->61.5 (10) 5/4 $11.80 1st:
Tookaboy 1:40.87 3.4L
TETK (R) 27 May 07 25 dys 2nd up 4 of 15 Mdn $7K 2100 D2.9 Wd,2nd otr
1000,3rd 150,btld well Michael Coleman [R52] 57 (9) 9/11 $17.40 1st:
Andynot
2:13.99 5.3L
ELLE (R) 16 Jun 07 20 dys 3rd up 3 of 11(wn) F-Mdn $10K 2100 S3.6 5th
outr,loomed 300,fght hard Michael Coleman [R55] 57 (3) 1/2 $3.40 1st: Katy
Keen 2:17.23 1.1L
TRAP (L) 27 Jun 07 11 dys 4th up 3 of 14(wfbn)M dn $6K 2100 S3.9 4th outr
to
tn,3rd 200,fght on Troy Harris [R56] 57 (4) 3/4 $5.40 1st: Spekt 2:14.88
1.4L
Racing well and building to a win. 2100m suits. Each way.
--------------------------------------------------------------------------
--
--
-----------------
2 98452 Gobi Hero (6) 3g b O'Reilly-Miss Daytona (by Kinjite) [Brave Fox
6g(O'Reilly), Florida 7m(Pompeii Court), Pique 4m(Pins), Talladega
5m(O'Reilly)]
Allan Peard 57kg (R57)
Royal blue, white crossed sashes, white cap
Stats:
Trainer: Bruce Wallace (Takanini)
Owner: B J Wallace
(W-off,B-on)
All 9:0:1:0:2
Prz $2,550
Win 0%
Plc 11%
SPR $283
Days 24
L 2:0:0
R 7:0:1
F 1:0:0
G 2:0:0
D 5:0:1
S 1:0:0
H 0:0:0
C 2:0:1
Dst 1:0:1
TrkD 1:0:1:0
L12-W 0%
L12-P 11%
L12 est $2,550
F90 1:0:0:0
F30 1:0:0:0
2Up 1:0:0:0
Fav 0:0:0:0
2 Fav 0:0:0:0
Perf:
AVON Trials 18 Nov 05 - - u/p of 5 2YO C/WGT 400 G Andrew Calder 1st: At
Sea
23.49
AVON Trials 13 Dec 05 - - u/p of 7 2YO C/WGT 800 G Catherine Treymane 1st:
French Raine 46.07
PAER Trials 10 Jan 06 - - u/p of 8 2YO C/WGT 900 G Rogan Norvall 1st:
Unnamed 53.30
PUKE Trials 30 Oct 06 - - u/p of 8 MDN C/WGT 880 D Brendan Sargent 1st:
Josun 54.19
PUKE Trials 17 Nov 06 - - u/p of 7 MDN C/WGT 1200 D Mark Hills 1st:
Unnamed
1:15.64
TARO (R) 29 Nov 06 - 1st up 13 of 13 Mdn3yo $6K 1400 F2.0 Rear inr,never a
hope Rogan Norvall [R50] 57 (9) 13/13 $81.60 1st: Shira 1:24.85 10.6L
Stipes report: Slow
PUKE (R) 20 Dec 06 21 dys 2nd up 9 of 13(bf) Mdn $7K 1400 D2.6 Beh midf
inr,did little inner Rogan Norvall [R50] 56 (2) 13/13 $106.90 1st:
Sherileon
1:25.29 5.2L
RUAK (R) 04 Jan 07 15 dys 3rd up 8 of 11 Mdn $6K 1600 G2.2 Hmprd st,bk
inr,little progress inr Rogan Norvall [R50] 56 (6) 8/8 $22.00 1st: Mango
Tree
(AUS) 1:36.99 9.2L
TRAP (L) 17 Mar 07 72 dys 4th up 4 of 11 F-Mdn $10K 1400 D2.8 Midf 3w cvr
to
tn,clawed closer David Walsh [R50] 56.5 (11) 8/8 $30.20 1st: Shining Light
1:24.45 4.3L
PUKE (R) 31 Mar 07 14 dys 5th up 9 of 12 F-Mdn3yo $10K 1600 D2.7 Beh midf
innr,out tn,weak finish Michelle Wenn [R55] 57 (3) 5/6 $17.50 1st: Dutyful
1:38.56 11.6L
TAUR (R) 21 Apr 07 21 dys 6th up 8 of 11 F-MdnHwt $10K 1600 G2.3 Trld,undr
rd 500,wknd 250m Brendan Sargent [R54] 64 (4) 6/6 $13.90 1st: Expectalot
1:37.96 10.5L
TRAP (L) 05 May 07 14 dys 7th up 4 of 15 F-Mdn $10K 1600 S3.6 6th innr,out
500,fght well outer Allan Peard [R53] 57 (2) 9/9 $31.10 1st: Allasin
1:37.81
3.8L
BB ELLE (R) 02 Jun 07 28 dys 8th up 5 of 15(wn) P-Mdn $15K 1600 D2.4 Mid
3w
cvr,fght closer wide Allan Peard [R55] 57 (12) 13/13 $35.20 1st:
Spurathoughtforme 1:37.22 5.8L
RUAK (R) 20 Jun 07 18 dys 9th up 2 of 14 Mdn $6K 2100 D2.8 Hdy 4th,disp ld
600m,kept fighting Allan Peard [R55] 57 (11) 3/4 $7.20 1st: Ontherox
2:12.94
1.5L
Fought well when much improved for second course distance 20/6. Include.


:

Explain what you want the macro to do.
Show an example of text before running the macro and show an example of
how
you want the text to look like after running macro.

Hello from Steved

The below Macro runs as it should when I run it manually ("Icon
Button"),
What do I need to do to it please to keep looping until the end off the
last
page Thankyou.

Sub Testing2()
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "<[A-Za-z]@>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeText Text:="= "
Selection.Extend
Selection.Find.ClearFormatting
With Selection.Find
.Text = "(by"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Find.ClearFormatting
With Selection.Find
.Text = ")"
.Replacement.Text = ""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top