Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro to replace text with new text in excel

Status
Not open for further replies.

spastica

Programmer
Sep 27, 2002
72
GB
I would like to create a macro that will search for values in a column, and replace them with new values accordingly.

for example, if the value in the cell is "xa" i would like to replace it with "ab", if it is "xo" i would like to replace it with "on" etc.

is there a way to do this with a macro, to loop through all records and replace accordingly?

sorry, if this is a simple question, i'm new to macros in excel.
 
spastica,

Turn on the Macro Recorder

Menu item Edit/Replace - enter find and replace string and execute

Trun off the macro recorder

Inspect your code. If you have trouble making it general, post back.

:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top