![]() |
#3
|
||||
|
||||
![]()
If the aim of the game is to delete xxx and yyy from each page but the first then
Code:
Sub DelTexts() Dim vFind As Variant Dim oRng As Word.Range Dim i As Integer vFind = Array("xxx", "yyy") For i = 0 To UBound(vFind) Set oRng = ActiveDocument.Range With oRng.Find Do While .Execute(FindText:=vFind(i), MatchWildcards:=True) If oRng.Information(wdActiveEndPageNumber) > 1 Then oRng.Text = "" End If oRng.Collapse 0 Loop End With Next i lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
page count, search and replace |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
knpaddac | Word | 1 | 01-14-2019 01:16 PM |
![]() |
mike0215 | Word VBA | 2 | 11-28-2017 07:25 AM |
Search for specific data in a text string | teligence | Excel | 1 | 05-20-2017 11:51 AM |
![]() |
mariur89 | Excel | 4 | 12-14-2014 01:33 AM |
![]() |
donaldadams1951 | Word VBA | 4 | 03-14-2014 11:24 AM |