JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
Manually, I can do:
Windows, launch CMD.exe (Start->Run cmd Enter)
[In DOS prompt] "cd /d D:\Serious\Work\Other People\Al\DataRead"
[DOS] "type *.csv > x.txt"
This creates concatenated text file of all csv files in folder.
If I run below VBA, I receive error: "The system cannot find the path specified."
Where Range("Folder").text contains a folder path ending with ""
Please someone help with code to automate these steps?
Ultimately, it will be used to concatenate CSV files in a DropBox folder, then write x.txt to Excel and analyse results.
TIA,
JackDanIce
Manually, I can do:
Windows, launch CMD.exe (Start->Run cmd Enter)
[In DOS prompt] "cd /d D:\Serious\Work\Other People\Al\DataRead"
[DOS] "type *.csv > x.txt"
This creates concatenated text file of all csv files in folder.
If I run below VBA, I receive error: "The system cannot find the path specified."
Code:
Sub testme()
Dim s As String: s = Range("Folder").Offset(, 1).Text
'1: vbNormalFocus
Call Shell("cmd.exe /k cd /d " & s, 1")
End Sub
Please someone help with code to automate these steps?
Ultimately, it will be used to concatenate CSV files in a DropBox folder, then write x.txt to Excel and analyse results.
TIA,
JackDanIce
Last edited: