Macro to replace 580 off them.

S

Steved

Hello from Steved

T( 9 0 4) S( 1 0 0) C( 0 0 0) D( 3 0 2) J( 6 0 2)

..Text = "[A-Z]\([0-9 ]{1,}\)" works fine but I would like to
Bold and increase the Font to 10 What do I need to do please,
with my attempt below to work Thankyou.

Sub DeleteT()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[A-Z]\([0-9 ]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
With Selection.Find.Font
.Size = 10
.Bold = True
Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
 
D

Doug Robbins

Try

Dim myrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]\([0-9 ]{1,}\) ",
MatchWildcards:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Set myrange = Selection.Range
myrange.Font.Size = 10
myrange.Font.Bold = True
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

Try

Sub DeleteT()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[A-Z]\([0-9 ]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Replacement.Text = ""
.Replacement.Font.Size = "10"
.Replacement.Font.Bold = True
Selection.Find.Execute replace:=wdReplaceAll
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Steved

Thankyou.

Doug Robbins said:
Try

Dim myrange As Range
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="[A-Z]\([0-9 ]{1,}\) ",
MatchWildcards:=True, _
Wrap:=wdFindStop, Forward:=True) = True
Set myrange = Selection.Range
myrange.Font.Size = 10
myrange.Font.Bold = True
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
Steved said:
Hello from Steved

T( 9 0 4) S( 1 0 0) C( 0 0 0) D( 3 0 2) J( 6 0 2)

.Text = "[A-Z]\([0-9 ]{1,}\)" works fine but I would like to
Bold and increase the Font to 10 What do I need to do please,
with my attempt below to work Thankyou.

Sub DeleteT()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[A-Z]\([0-9 ]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
With Selection.Find.Font
.Size = 10
.Bold = True
Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
 
S

Steved

Thankyou

Graham Mayor said:
Try

Sub DeleteT()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[A-Z]\([0-9 ]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Replacement.Text = ""
.Replacement.Font.Size = "10"
.Replacement.Font.Bold = True
Selection.Find.Execute replace:=wdReplaceAll
End With
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Hello from Steved

T( 9 0 4) S( 1 0 0) C( 0 0 0) D( 3 0 2) J( 6 0 2)

.Text = "[A-Z]\([0-9 ]{1,}\)" works fine but I would like to
Bold and increase the Font to 10 What do I need to do please,
with my attempt below to work Thankyou.

Sub DeleteT()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[A-Z]\([0-9 ]{1,}\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
With Selection.Find.Font
.Size = 10
.Bold = True
Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
 

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