Data From Multiple Files

Peter Quill

Member
Local time
Today, 14:31
Joined
Apr 13, 2023
Messages
30
Hello,

I have certain files in a folder with data. I wish to collect all the data from all the files.

TIA.
 
Last edited:
Code:
Sub Import_Data()
    Dim sPath As String
    Dim sFile As String
    Dim sArchive As String

    sPath = "X:\Importfiles\"
    sArchive = "X:\Importfiles\Archive\"
 
    sFile = Dir(sPath & "*.*")
    Do While sFile > vbNullString
        'Debug.Print sFile

        ' => IMPORT statement, for example append query

        ' move file
        Name sPath & sFile As sArchive & sFile
        sFile = Dir
    Loop
End Sub
 
tell us more, what fields you have on plant records?
can all fields be found in your files?
what are your files?, excel files, text files?
 

Users who are viewing this thread

Back
Top Bottom