HowdeeDoodee
Well-known Member
- Joined
- Nov 15, 2004
- Messages
- 599
Can Excel be used to open, find and replace multiple words in text files, and then close and save the text files?
In col A I have the directory and file name where the text files are located.
In col B I have the words or terms to find
In col C I have the words or terms to replace replace when the col B term is found.
I would like the macro to go down the sheet, open the txt files listed in col A.
After the file is open I would like the macro to replace all the terms listed in col B with the associated term on the same row in col C.
The macro must find and replace all of the col B terms with all of the col C terms in all of the txt files, not just the txt file on the same row as the file name.
Thank you in advance for your reply.
In col A I have the directory and file name where the text files are located.
In col B I have the words or terms to find
In col C I have the words or terms to replace replace when the col B term is found.
I would like the macro to go down the sheet, open the txt files listed in col A.
After the file is open I would like the macro to replace all the terms listed in col B with the associated term on the same row in col C.
The macro must find and replace all of the col B terms with all of the col C terms in all of the txt files, not just the txt file on the same row as the file name.
Thank you in advance for your reply.
Excel Workbook | |||||||
---|---|---|---|---|---|---|---|
A | B | C | |||||
1 | File Name | Find | Replace With | ||||
2 | E:\Replace\green.txt | power | powerless | ||||
3 | E:\Replace\red.txt | trust | distrustful | ||||
4 | E:\Replace\purple.txt | be free | be confined | ||||
5 | E:\Replace\brown.txt | not to worry | worry a lot | ||||
6 | E:\Replace\black.txt | give it away | take it back | ||||
7 | E:\Replace\Now.txt | NIV HTML Previous Left | 8 | E:\Replace\Today.txt | NIV HTML Middle1 | ">Previous Verse (NIV)>>> | |
9 | E:\Replace\Scct.txt | NIV HTML Middle2 | 10 | E:\Replace\Trd.txt | NIV HTML Right | ">Next Verse (NIV) | |
Sheet1 |