Read text file, add data and then write text file VBA
Posted on 2014-01-20
I have a spreadsheet with about 110 lines of data and I need to dynamically generate a text file for each of the rows in the spreadsheet. The text file is a prf file to configure outlook and requires that only certain sections are changed to match the spreadsheet. What I would like to achieve is reading a text file, adding the required data then reading the next section of the file adding data etc. I need to do this with a VBA macro, I have created a macro which outputs concatenated data to a text file but the file looses all formatting which is not acceptable so I think the only way is to read a file, add data and repeat the process and once this is done output a text file. Unfortunately I have no clue how to achieve this can anyone spread any light on this or provide some example code?
Thanks in advance,