Sheraz said:
Hi Dirk, thnx for the code, actually i do know the names of the
files, anD we can say that they are located in a folder s:\Exch Patch
Status,
names are like JHM, NHM,AMT,A1P,A2P,WSI,WCI,......,
I hope the code will be changed in this case,, waiting fro a respone
It's not a question of changing the code, because the Sub I posted is
designed to be called from another routine that provides the input and
output file paths. So, for example, with that Sub in place, you might
have another procedure that calls it for each file, like this:
'----- start of code for calling procedure -----
Sub AppendAllFiles()
Dim strFolder As String
Dim strOutputFile As String
strFolder = "s:\Exch Patch Status\"
strOutputFile = strFolder & "MASTER.txt"
AppendTextFile strFolder & "JHM.txt", strOutputFile
AppendTextFile strFolder & "NHM.txt", strOutputFile
AppendTextFile strFolder & "AMT.txt", strOutputFile
AppendTextFile strFolder & "A1P.txt", strOutputFile
AppendTextFile strFolder & "A2P.txt", strOutputFile
AppendTextFile strFolder & "WSI.txt", strOutputFile
AppendTextFile strFolder & "WCI.txt", strOutputFile
' ... and so on ...
End Sub
'----- end of code for calling procedure -----