Skip to main content

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

Author: Siluvia Last Modified: 2024-07-17

Finding and replacing words in a Word document is a common task, especially when you need to make consistent changes throughout a lengthy document. However, if you need to find and replace multiple words simultaneously, doing it one by one can be time-consuming. Fortunately, there are efficient ways to accomplish this task.

In this tutorial, we will show you how to find and replace multiple words at the same time in a Word document using two methods:

Find and replace multiple words at the same time in Word with VBA
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

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, separated by comma: ", "Kutools for Word")
    xReplace = InputBox("Enter new items here, separated 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:

Enter entries to be replaced in this dialog

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.

Enter new entries to use in this dialog

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 applying this feature, please take minutes to download and install it firstly.

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

Batch Find and Replace option of Kutools

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

  • 2.1 click the Add button button > Add File or Add Folder to add one or more documents in which you will find and replace multiple words.
    Batch Find and Replace window
  • 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:

Batch Find and Replace window 2

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.

Kutools for Word is the ultimate Word add-in that streamlines your work and boosts your document processing skills. Get It Now!

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

🤖 Kutools AI Assistant: Transform your writing with AI - Generate Content  /  Rewrite Text  /  Summarize Documents  /  Get Quick Answers, all within Word

📘 Document Mastery: Split Pages  /  Merge Documents  /  Export Selection in Various Formats (PDF/TXT/DOC/HTML...)  /  Batch Convert to PDF  /  Export Pages as Images  /  Print Multiple Files at once...

Contents Editing: Batch Find and Replace across Multiple Files  /  Resize All Pictures  /  Transpose Table Rows and Columns  /  Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces  /  Section Breaks  /  All Headers  /  Text Boxes  /  Hyperlinks  /  For more removing tools, head to the Remove group...

Creative Inserts: Insert Thousand Separators  /  Check Boxes  /  Radio Buttons  /  QR Code  /  Barcode  /  Diagonal Line Table  /  Equation Caption  /  Image Caption  /  Table Caption  /  Multiple Pictures  /  Discover more in the Insert group...

🔍 Precision Selections: Pinpoint Specific Pages  /  Tables  /  Shapes  /  Heading Paragraphs  /  Enhance navigation with more Select features...

Star Enhancements: Navigate to Any Location  /  Auto-Insert Repetitive Text  /  Toggle Between Document Windows  /  11 Conversion Tools...

Kutools and Kutools Plus tabs on the Word Ribbon
👉 Want to try these features? Download Kutools for Word now! 🚀
 
Comments (23)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
The VBA script you provide here seems to work only for Latin characters; is there some workaround to get special characters to work.
I work with Sanskrit, which used the Devanagari script, similar to Hindi. (1) The VBA does not accept the Devanagai font nor does it find the Latin characters with diacriticals. For example: It fails miserably if I search for mūlādhāra (मूलाधार). It doesn't seem to recognize the ū or ā, for example, and the Devanagari is a complete loss.

Moreover, does the script recognize spaces between words? If not, how do I get them in there?

Thank you!
This comment was minimized by the moderator on the site
Chào bạn, có cách nào thay thế RẤT NHIỀU cụm từ bằng RẤT NHIỀU cụm từ khác (nhập từng cụm từ rất mất thời gian) bằng cách m lập một file trong đó có 2 cột, 1 cột là cụm từ nguồn và cột 2 là cụm từ đích được không? rất cám ơn bạn.
This comment was minimized by the moderator on the site
Hi Nguyễn Phúc Lâm,
I recommand you apply the Batch Find and Replace feature of Kutools for Word (the second method in this post) to solve this problem.
In the Find and Replace dialog box, after creating the two columns you need, you can save the current settings as a scenaria for future use.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/find_and_replace.png
This comment was minimized by the moderator on the site
Cám ơn Crystal, cách này có thể áp dụng với một số lượng nhỏ các cụm từ, nếu với số lượng các cụm từ lớn (hơn 1000, hơn 10000.. cụm từ) thì rất khó để có thể nhập thủ công. Vậy có cách nào khác không bạn? Cám ơn bạn đã trả lời
This comment was minimized by the moderator on the site
Hi Nguyễn Phúc Lâm,
Temporarily unable to deal with this problem with VBA code as it is a bit complex. This feature will be considered for upgrade in the next release. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Thanks for the project, Could you make it the way we can also replace letters in words. For example if i want to change Dollar as DoLLar it does not function.
This comment was minimized by the moderator on the site
In the first instruction (Find And Replace Multiple Words At The Same Time In Word With VBA Code), it does not find instances where the word to be replaced falls in the middle of a word (For example, .com following a website name). Can this be modified to do so?
This comment was minimized by the moderator on the site
What if I'm trying to replace commas?
This comment was minimized by the moderator on the site
The VBA code can't help to replace commas. You can apply Kutools to achieve.
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations