View Single Post
 
Old 04-18-2017, 03:58 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Text = "[ ]{4}|Z|"
    .Replacement.Text = "ZR"
    .Execute Replace:=wdReplaceAll
    .Text = "|"
    .Replacement.Text = ""
    .Execute Replace:=wdReplaceAll
    .Text = "[ ]^13"
    .Replacement.Text = "^p"
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
On my laptop, with 10,000 records to process, execution takes just 21 seconds.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote