View Single Post
 
Old 07-30-2024, 12:07 AM
Shelley Lou Shelley Lou is offline Windows 10 Office 2016
Expert
 
Join Date: Dec 2020
Posts: 259
Shelley Lou is on a distinguished road
Default VBA Add text to beginning of each row in second column

Hi Vivka, I've added the replacement code and have also added for the text to not be bold. How do I stop the quote mark from changing though, it should remain bold - I did add \2 to .Replacement.text = "\1\2means (" - but that only changed one definition and not the rest - any ideas?

Capture.JPG

Code:
Sub Enter_Wd()
Dim oRng As Range
Set oRng = Selection.Range
    oRng.Find.ClearFormatting
    oRng.Find.Replacement.ClearFormatting
    With oRng.Find
    .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
        .text = "(^34^9)\("
        .Replacement.text = "\1means ("
        .Replacement.Font.Bold = False
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Reply With Quote