Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Files into One

Status
Not open for further replies.

DummyForAccess

Technical User
Aug 7, 2002
38
0
0
US
Help, it's been a while since I've done ANY coding in VB. I'm trying to copy several excel files into one, I want it to work just like a .bat file will work if you use code something like: copy file1.csv + file2.csv file3.csv
In this case file3.csv would have the data from file 1 and 2 combined into it. Is there syntax in VB that would do the same function?
 
The simplest syntax would be...

Shell("copy file1.csv + file2.csv file3.csv")

Of course, you will probably want to add the drive and path for each file. If you have spaces in the folder name, you'll need to add extra quotes.

Shell("copy ""C:\Folder With Space\file1.csv"" + ""C:\Folder With Space\file2.csv"" ""C:\Another Folder With Space\file3.csv""")




-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top