Quote:
Originally Posted by vivka
Hi! It's not difficult:
Code:
Sub Test()
Dim oRng As range
Set oRng = selection.range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.text = "Y[! ]@" & Chr(13)
.Format = False
.Forward = True
.MatchWildcards = True
.Wrap = wdFindStop
.MatchAllWordForms = False
.MatchSoundsLike = False
If .Execute Then oRng.Select
End With
Set oRng = Nothing
End Sub
Modify the code to meet your needs.
|
You have me at a disadvantage with the value of .Text. I've looked but nothing good really jumped out at me with regard to special characters. Microsoft Help was not much. What is a good reference for all such special codes when searching for text? I've seen combinations of [], (), /, \, *, whatever. I just want to be able to recognize when there is one, specific word/string alone on a line that starts with a letter of my choosing. In my case it will be an X or Y. No whitespaces in this string.