Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Sweet31
Femeie
25 ani
Bucuresti
cauta Barbat
25 - 47 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL, WORD etc.] Replace multiple values at the same time Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TonyTzu
Moderator

Inregistrat: acum 12 ani
Postari: 252
I work daily with lots of documents and sometimes I have to change data in all of them and replace some strings with others.
For example, I used the following method to replace year 2015 from header in word with 2016 and also to replace certain numbers with other numbers, all at the same time.

This is done through use of a freeware application called Useful File Utilities (UFU) which is a file browser similar to Total Commander.

You can download it and it's Batch Replacer plugin from here:

After you install here's how to use it:

1. Open UFU program and select Batch Replacer (see screenshot below)

2. Navigate to the location of your files and when there, select them with right click.

3. On the right of the window there is the Batch Replacer pane. Add all the strings you need replaced and the strings to replace them. You can save your list of strings for later use (the list can be opened with notepad and easily modified or it can be modified directly in UFU).

4. It's always good to have a backup, just in case, but if you don't need one, untick the option.

5. Click the Start Replace button and wait for it to finish - a new window will appear that will show the progress and then results of your replacements.

I also added a preview of the word documents before and after the replace - see below.



pus acum 8 ani
   
TonyTzu
Moderator

Inregistrat: acum 12 ani
Postari: 252
Other method, with macro and only for excel - UNTESTED

Source

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



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.

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.



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



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


pus acum 8 ani
   
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2186
To substitute multiple characters either use multiple SUBSTITUTE and INDEX functions or use VBA with a custom function:

_______________________________________


pus acum 4 ani
   
Pagini: 1  

Mergi la