-
WildCard Replace
Hi All,
I am new to this Forum.
I had created Macro using MS Words Record Macro. Its working fine.
The Macro replaces “Tab”a b c”Tab” to <ref>“Tab”a,b,c”Tab”</ref> (Replaces spaces to comma inbetween the tab and inserts the <ref> tag).
Record Macro is for your ref:
Sub Macro5()
'
' Macro5 Macro
' Macro recorded 5/10/10 by RJ
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^t([a-z]) ([a-z]) ([a-z])^t"
.Replacement.Text = "<ref>^t\1,\2,\3^t</ref>"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Can it possible to replace the following conditions in a single macro
“Tab”a b c”Tab” to <ref>“Tab”a,b,c”Tab”</ref>
or
“Tab”a b”Tab” to <ref>“Tab”a,b”Tab”</ref>
or
“Tab”a”Tab” to <ref>“Tab”a”Tab”</ref>
Helpful Mind will always be appreciated.
Thanks,
Rakesh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules