Macro will not stop at the bottom off the page.

S

Steved

Hello from Steved

Below I want to delete as you see in my Macro but it will stop at the bottom
off the page. Have you any solutions to my issue please. Thankyou.

All 8:0:1:1:3
Prz $3,600
Win 0%
Plc 25% L 1:0:1
R 7:0:1
F 0:0:0

Sub Win()
Dim i As Long
For i = 1 To ActiveDocument.Paragraphs.Count
If i > 1 Then
Set MyRange = ActiveDocument.Paragraphs(i).Range
MyRange.End = MyRange.Start + i
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Win [0-9]{1,}%"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=2
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Plc [0-9]{1,}%"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.Delete Unit:=wdCharacter, Count:=2
End If
Next i
End Sub
 
S

Steved

Hello Christian

What happens when it gets to the bottom it then delets all the way backup to
the top off the page leaving the page blank.
 
S

Steved

Hello Jezebel

I got nothing against blank pages just that I have not got round to how
would one read it.
 
D

Doug Robbins - Word MVP

That's the point, it saves you from going to the trouble of reading it.

--
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
 
S

Steved

Hello Doug

you are ahead off me on this one, but yes you are right, but when the boss
looks at a blank page I would wonder if he has a sence of humor like the rest
off us.
 
D

Doug Robbins - Word MVP

That's why he's the boss.

--
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
 
S

Steved

I've finally understood Cheers.

Doug Robbins - Word MVP said:
That's why he's the boss.

--
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
 

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