View Single Post
Old 11-29-2006, 12:25 AM   #12
Junior Member
svr began at the beginning.
Posts: 3
Karma: 10
Join Date: Nov 2006
Device: Sony Reader
Try this Macro for deleting multiple spaces.
There is a space between the [] brackets in the .TExt parameter. The numbers between the curly braces indicate how many spaces you want to look for, in this case I am searching or a minimum of 2 spaces upto a maximum of 6, you can make it as many as you want. But leave the minimum at 2, otherwise you will have one massive word!!

Sub DeleteMultipleSpaces()
' DeleteMultipleSpaces Macro

With Selection.Find
.Text = "([ ]{2,6})"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
svr is offline   Reply With Quote