PDA

View Full Version : [SOLVED:] Find and replace advice needed



Kilroy
07-25-2016, 11:38 AM
I have been trying to figure out how to replace a "space" with a "tab" when the space is preceded by a number [0-9] or a closing bracket ). Any ideas?

Paul_Hossler
07-25-2016, 01:33 PM
Just recording a macro



Sub Macro2()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([0-9\)]) "
.Replacement.Text = "\1^t"
.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

Kilroy
07-25-2016, 04:33 PM
Thanks Paul works perfect