Excel VBA - open text file, replace text, save file?

  • Thread starter Thread starter Cybert
  • Start date Start date
C

Cybert

I have a spreadsheet with 287 rows.

Column 1 is a short text string. (string1)
Column 2 is a slightly different text string. (string2)

I need to search through approximately 25,000 short text files (in a
variety of different folders) and REPLACE all occurences of string1
with string2.

Can I [fairly easily] write a VBA routine to do this automatically?
It's going to take me DAYS to make all the changes by hand. If I
can't do it with Excel is there another tool that would do the trick?
 
I think the most difficult part is gonna be specifying those 25,000 text files.

If you can do that (maybe a list in column A of another worksheet???), you could
loop through those files and run a macro based on the code in this thread:

http://google.com/[email protected]


I have a spreadsheet with 287 rows.

Column 1 is a short text string. (string1)
Column 2 is a slightly different text string. (string2)

I need to search through approximately 25,000 short text files (in a
variety of different folders) and REPLACE all occurences of string1
with string2.

Can I [fairly easily] write a VBA routine to do this automatically?
It's going to take me DAYS to make all the changes by hand. If I
can't do it with Excel is there another tool that would do the trick?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top