Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to find and replace multiple values at once in Excel?

doc multiple find replace 1

As we all known, we can use Find and Replace function to find multiple same cell and replace them with a value as you need. But sometimes, you need to apply many-to-many replacement simultaneously. For example, I have a range of data, and now I want to replace all Apples to Red Apples, Oranges to Green Oranges, Bananas to Yellow Bananas and so on as following screenshots shown, do you have any good ideas to solve this task in Excel?

Find and replace multiple values at once with VBA code


Find and replace in opened workbooks or multiple worksheets:

Kutools for Excel’s Find and Replace feature can help you to find and replace the values from opened workbooks or specific worksheets you need.

doc-multiple-find-and-replace-6

arrow blue right bubble Find and replace multiple values at once with VBA code


If you are tired of find and replace the values time and time again, the following VBA code can help you to replace multiple values with your needed texts at once.

1. Please create your conditions that you want to use which contain the original values and new values. See screenshot:

doc multiple find replace 2

2. Then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

3. Click Insert > Module, and paste the following code in the Module window.

VBA code: Find and replace multiple values at once

Sub MultiFindNReplace()
'Update 20140722
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Original Range ", xTitleId, InputRng.Address, Type:=8)
Set ReplaceRng = Application.InputBox("Replace Range :", xTitleId, Type:=8)
Application.ScreenUpdating = False
For Each Rng In ReplaceRng.Columns(1).Cells
    InputRng.Replace what:=Rng.Value, replacement:=Rng.Offset(0, 1).Value
Next
Application.ScreenUpdating = True
End Sub

4. Then press F5 key to run this code, in the popped out prompt box, please specify the data range that you want to be replaced the values with new values.

doc multiple find replace 3

5. Click OK, and another prompt box is displayed to remind you select the criteria which you are created in step 1. See screenshot:

doc multiple find replace 4

6. Then click OK, all the specific values have been replaced with the new values as you need immediately.

doc multiple find replace 5


Related articles:

How to find and replace specific text in text boxes?

How to find and replace text in chart titles in Excel?

How to find and replace text within comments in Excel?

How to change multiple hyperlink paths at once in Excel?


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
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.
    Jairo L. · 13 days ago
    Muchas Gracias me fue de mucha utilidad el codigo.
  • To post as a guest, your comment is unpublished.
    iris · 1 months ago
    it works! THANK YOU SO MUCH!
  • To post as a guest, your comment is unpublished.
    Jon · 4 months ago
    Макрос не работает корректно !!! Пытался подобным образом заменить символы, но не различаются маленькие и большие буквы.
  • To post as a guest, your comment is unpublished.
    Ugnė Vitkutė · 5 months ago
    Hi, I would like to replace whole cells in the entire Excel file (with many sheets). What should be replace in the Original Range to do that? Thanks.
  • To post as a guest, your comment is unpublished.
    Ugne · 5 months ago
    What should be replaced in the code to run it on all the Excel file's sheets?