how multiple rename in one excel file

niksirat2030

New Member
Joined
Nov 16, 2015
Messages
9
hi everyone,

i have one excel file, i want rename several word or number with another, for example:

6037991816468777 --> jack
6037991845127846 --> john
.
.
.
how can i do it?

thanks in advance.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Code:
Sub myRenameMacro()
     myFrom = InputBox("What do you want to rename?")
     myTo = InputBox("What do you want to rename it to?")
     For Each cel in Worksheets
          If cel.Value = myFrom Then
               cel.Value = myTo
          End If
     Next cel
End Sub
 
Upvote 0
Code:
Sub myRenameMacro()
     myFrom = InputBox("What do you want to rename?")
     myTo = InputBox("What do you want to rename it to?")
     For Each cel in Worksheets
          If cel.Value = myFrom Then
               cel.Value = myTo
          End If
     Next cel
End Sub

thanks for your answer, but how can i use this code?

for example , i have 2 txt file, Input.txt and Output.txt and i want replace each line of input.txt with same line

of Output.txt.
 
Upvote 0
This code will not work for you as I thought you wanted to change values of a sheet not a text file.
 
Upvote 0

Forum statistics

Threads
1,216,045
Messages
6,128,484
Members
449,455
Latest member
jesski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top