concatenating files

  • Thread starter Thread starter Jeff Ellison
  • Start date Start date
J

Jeff Ellison

VBA beginner.....Can anyone offer a script or suggestions
that takes multiple text files and combines them into one
single file. Thank you!
 
The DOS copy command is capable of doing this and would probably be the easiest. You could
do it yourself in VBA by opening each file, reading it line by line, and outputting it to
another file that you keep open during the whole process. To use the DOS copy command, you
could use the Shell command in VBA.

Example:
Shell "command.com /c copy file1.txt+file2.txt+file3.txt Newfile.txt", vbHide
 
Back
Top