• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Macro to replace txt string with value from Excel

Vishal.bedre

New Member
Hi Awesome People:

I am from Mainframe background and I rarely create VBA Macros. My requirement is that I want to take a cell value(for eg: A1) and then replace a particular word in a txt file.

eg: A1 = Userid.appln.date (MyExcel.xls)

Input notepad(Mfjob.txt)
//job card
//DSN=getvalue,DISP=SHR

Output notepad(Mfjob.txt):
//job card
//DSN=Userid.appln.date,DISP=SHR
 
Vishal

Firstly, Welcome to the Chandoo.org Forums

If it is a single word you want to replace or a one off job, I'd recommend opening the file in Wordpad and do a Search/Replace for the particular word/s

If it is more complex can you post a sample file ?

Is it going to be every file in a directory ?
Do you need to be able to choose the file ?
Are there multiple words to search/replace in each file ?
 
Back
Top