Can I add "Plc [0-9]{1,}%"

S

Steved

Hello From Steved Thankyou in Advance.

Can I add "Plc [0-9]{1,}%" to the below macro or do I have to have 2 macro's
please.

Sub Win()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Win [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
End With
End Sub
 
G

Greg Maxey

Did you try?

Sub WinOrPlc()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Win [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
Do While .Execute(FindText:="Plc [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
End With
End Sub
 
S

Steved

Hello Greg

Yes I did with the exception, I left out Loop

Thankyou.

Greg Maxey said:
Did you try?

Sub WinOrPlc()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Win [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
Do While .Execute(FindText:="Plc [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
End With
End Sub

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Hello From Steved Thankyou in Advance.

Can I add "Plc [0-9]{1,}%" to the below macro or do I have to have 2
macro's please.

Sub Win()
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="Win [0-9]{1,}%", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=True) = True
Selection.Paragraphs(1).Range.Delete
Loop
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