Replace Words In Word At The Same Time With This Trick

Опубликовано: 15 Октябрь 2024
на канале: usemybox
1,022
5

Learn how to replace words in Word at the same time with this quick trick.

Find and replace is useful for replacing single words at once in your document, but what if you want to replace multiple words at the same time? There is a solution.

Here is the code used in the video. Paste it in between 'Sub MacroName' and 'End Sub' of your macro:

Dim StrFind As String, StrRepl As String
Dim FindItem As String, ReplaceItem As String
Dim i As Long

StrFind = "Cook, Bake"
StrRepl = "Cooking, Baking"

Set RngTxt = Selection.Range

For i = 0 To UBound(Split(StrFind, ","))

FindItem = Split(StrFind, ",")(i)
ReplaceItem = Split(StrRepl, ",")(i)
Selection.HomeKey wdStory
With Selection.Find

.Text = FindItem
.Replacement.Text = ReplaceItem
.MatchWholeWord = True
.Execute Replace:=wdReplaceAll

End With

Next i

If you are interested in more information about Microsoft then I highly recommend the channel @Microsoft

#wordtutorial #microsoftwordtutorial #usemybox

Remember to subscribe to Usemybox for technology educational how to videos, Excel tutorials, Microsoft Word tutorials, Powerpoint tutorials and hacks for Windows, internet browsers and more.

Subscribe for More Computer Tips & Hacks:
https://youtube.com/usemybox?sub_conf...

(this video is about: replace words in word,replace words in word at the same time,replace multiple words in word,find and replace words in word,replace words in microsoft word,how to replace words in word,replace words in word tutorial,replace words microsoft word,replace a word in word,find and replace word,replace words at the same time,how to replace multiple words in word,word tutorial,microsoft word tutorial,usemybox)