Quote:
Originally Posted by gmaxey
If you want a macro that simply deletes all but the first tab in each paragraph of text, you could use:
|
Alternatively, and usually much quicker than looping through all paragraphs:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
.InsertBefore vbCr
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "(^13[!^13]@^t[!^13]@)^t"
.Replacement.Text = "\1 "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Do While .Find.Execute = True
.Find.Execute Replace:=wdReplaceAll
Loop
.Characters.First.Text = vbNullString
End With
Application.ScreenUpdating = True
End Sub