Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2K Find and Replace w/wildcard

Status
Not open for further replies.

crjo

Programmer
Jul 3, 2001
15
US
I have about 10 pages of text that looks something like this: 9/12/2003,1098,9/15/2003,3421,10/1/2003,7856 etc.

I would like to replace the comma between the last digit of the number and the first digit of the date with a carriage return. Can I do this with a wildcard string?
 
Hi,

You could do a Replace 12 times of

,1/

with

^p1/

then chage 1 to 2 up to 12

OR run this macro
Code:
Sub ReplA()
    For i = 1 To 12
        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
            .Text = "," & i & "/"
            .Replacement.Text = "^p" & i & "/"
            .Forward = True
            .Wrap = wdFindContinue
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
    Next
End Sub
:)


Skip,
Skip@TheOfficeExperts.com
 
Went with the macro. Thanks Skip!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top