How to find and replace multiple words at the same time in a Word document?

Word provides a Find and Replace function to find all instances of a word or phrase and replace them with a new word at the same time. But if you want to find and replace different words at the same time, this build-in function can’t help. In this article, we are talking about a VBA method to find and replace multiple different words at the same time in Word document.

Find and replace multiple words at the same time in Word with VBA code
Easily find and replace multiple words at the same time in Word with an amazing feature


Find and replace multiple words at the same time in Word with VBA code

Please do as follows to find and replace multiple word at the same time in a Word document.

1. Open the Word document you want to find and replace multiple words at the same time, then press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, click Insert > Module. Then copy below VBA code into the Module window.

VBA code: Find and replace multiple words at the same time in Word

Sub FindAndReplaceMultiItems()
'Update by ExtendOffice 2018/10/25
    Dim xFind As String
    Dim xReplace As String
    Dim xFindArr, xReplaceArr
    Dim I As Long
    Application.ScreenUpdating = False
    xFind = InputBox("Enter items to be found here,seperated by comma: ", "Kutools for Word")
    xReplace = InputBox("Enter new items here, seperated by comma: ", "Kutools for Word")
    xFindArr = Split(xFind, ",")
    xReplaceArr = Split(xReplace, ",")
    If UBound(xFindArr) <> UBound(xReplaceArr) Then
        MsgBox "Find and replace characters must be equal.", vbInformation, "Kutools for Word"
        Exit Sub
    End If
    For I = 0 To UBound(xFindArr)
        Selection.HomeKey Unit:=wdStory
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = xFindArr(I)
            .Replacement.Text = xReplaceArr(I)
            .Format = False
            .MatchWholeWord = False
        End With
        Selection.Find.Execute Replace:=wdReplaceAll
    Next
    Application.ScreenUpdating = True
End Sub

3. Press the F5 key to run the code.

4. In the first Kutools for Word dialog box, enter the multiple words you will find and replace into the textbox, and separate them with comma, then click the OK button. See screenshot:

5. In the second Kutools for Word dialog box, enter the new words you will replace with (these words also need to be separated by commas), and then click the OK button.

Note: In this case, all “KTE” in this document will be replaced with “New”, and “KTO” and “KTW” will be replaced with “Test” and “Finish”. Please change them to your needs.


Easily find and replace multiple words at the same time in Word with an amazing feature

The Batch Find and Replace feature of Kutools for Word can help to easily find and replace different texts in a document or across multiple documents at the same time.

Before apply this feature, please take minutes to download and install it firstly.

1. Launch the Microsoft Word application, click Kutools Plus > Batch Find and Replace.

2. In the Batch Find and Replace window, please configure as follows.

  • 2.1 click the button > Add File or Add Folder to add one or more documents in which you will find and replace multiple words.
  • 2.2 Click the Add row button to insert the find and replace fields. If you want to find and replace three different texts at the same time, please create three rows.
  • 2.3 In each row, enter the existing words you will replace with a new one in the Find column, and then enter the new words into the Replace column.
  • 2.4 Specify the Search Type for each row.
  • 2.5 In the Find in column, choose where to apply the find and replace. It includes Main document, Header and Footer in this section. You can choose one of them, two of them or all of them based on your needs.
  • 2.6. Click the Replace button to start the operation. See screenshot:

Then the specific words are replaced in selected documents at the same time.

Tip: You can highlight the result with background color by specifying certain color in the Highlight column for a row.

  If you want to have a free trial (60-day) of this utility, please click to download it, and then go to apply the operation according above steps.



Recommended Word Productivity Tools

 

Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    JM · 2 months ago
    Hi how can this macro be revised to take more key words? I have about 170 words that I wold like to find and replace
    • To post as a guest, your comment is unpublished.
      crystal · 1 months ago
      Hi JM,
      After running the code, a Kutools for Excel dialog box will pop up, please enter the keywords you will find and separate them with commas.
  • To post as a guest, your comment is unpublished.
    Ranjit Jagtap · 6 months ago
    How to find and select multiple words at the same time
    • To post as a guest, your comment is unpublished.
      crystal · 1 months ago
      Hi,
      After running the code, a Kutools for Excel dialog box will pop up, please enter the keywords you will find and separate them with commas.
  • To post as a guest, your comment is unpublished.
    Shailesh Pateliya · 10 months ago
    Hi, This works well with English Words. Now I am doing a document where I translate English to Gujarati. So, when I apply this, (Find English Words) and (Replace with Gujarati words), it does change but it appears like "???". Doesn't show the Gujarati word but just question marks? Any further help? Please.
  • To post as a guest, your comment is unpublished.
    Adam · 11 months ago
    Any way to make this case sensitive?
  • To post as a guest, your comment is unpublished.
    rishabh jain · 1 years ago
    will this work in office Excel 365
  • To post as a guest, your comment is unpublished.
    jaka1 · 1 years ago
    Toto jsem hledal, jen potřebuji pro hledaný text přidat nějaké formátování. Jak toho dosáhnu?