concatenating files

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!
 
W

Wayne Morgan

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
 
Top