T
ThomasJColby
Word2000; I want code to find each series of 6 digits and
add a - between digits 5 and 6 for example 606380412 would
become 60638-0412
I can make this happen 1 time, 10 times, and so on because
I do not know how to make it simply find and fix all. Here
is the code I created to find and fix 1 occurence. Thanks
for your help!!!
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^#^#^#^#^#^#^#^#^#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.MoveLeft Unit:=wdCharacter, Count:=4
Selection.TypeText Text:="-"
End Sub
add a - between digits 5 and 6 for example 606380412 would
become 60638-0412
I can make this happen 1 time, 10 times, and so on because
I do not know how to make it simply find and fix all. Here
is the code I created to find and fix 1 occurence. Thanks
for your help!!!
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^#^#^#^#^#^#^#^#^#"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.MoveLeft Unit:=wdCharacter, Count:=4
Selection.TypeText Text:="-"
End Sub