View Single Post
 
Old 10-24-2023, 10:11 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Code:
Sub Space_Starting_Paras_Del_1()
'In footers, delete spaces, unbr spaces & tabs starting paras.

Dim myRng As range
    
Application.ScreenUpdating = False

  Set myRng = ActiveDocument.StoryRanges(2)
    selection.Find.ClearFormatting
    selection.Find.Replacement.ClearFormatting
    With myRng.Find
        .text = "[^32^s^9]{1;}([!^13]@^13)"
        .Replacement.text = "\1"
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
        .text = "[^13]{2;}"
        .Replacement.text = ""
        .Execute Replace:=wdReplaceAll
    End With
 Application.ScreenUpdating = True
Set myRng =Nothing
 End Sub
Reply With Quote