Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-30-2024, 12:07 AM
Shelley Lou Shelley Lou is offline VBA Add text to beginning of each row in second column Windows 10 VBA Add text to beginning of each row in second column Office 2016
Expert
VBA Add text to beginning of each row in second column
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Add text to beginning of each row in second column Column issues.... Inserting text in column one moves text in column two kita299 Word 3 01-15-2023 05:06 PM
VBA Add text to beginning of each row in second column Add text at beginning of cells in Word table WJSwanepoel Word VBA 2 08-17-2022 05:11 AM
Automatically put a text string at the beginning of a paragraph jthomas666 Word 2 08-22-2019 12:27 PM
VBA Add text to beginning of each row in second column Add text to the beginning/ending of each line in word ballmoney Word 1 01-17-2010 02:19 AM
Looping macros to add text to beginning and end of a paragraph pachmarhi Word VBA 0 02-16-2009 06:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:03 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft