• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

copy multiple files into different sheets

Rodrigues

Member
Hi There
I would like to copy data from different files into a individual sheets on a daily "master" file, without to have to open the source files using vba, in the easier and simplest way possible.

Example:
Folder C:\PA

25 CSV files from 2017-07-04 Batch Yield Report 0000-0059 until 2300-2359

(some source files examples):
2017-07-04 Batch Yield Report 0000-0059
2017-07-04 Batch Yield Report 0100-0159
2017-07-04 Batch Yield Report 0600-0659
2017-07-04 Batch Yield Report 2200-2259
2017-07-05 Batch Yield Report 2300-2359 (last one and has next day date, however the data belongs to the previous day (4th), so needs to be copied with all of 4th date files too.

The data on each file needs to be pasted on each individual sheet on "daily master" file
2017-07-04 Batch Yield Report 0000-0059 (first file) - Sheet1
2017-07-04 Batch Yield Report 0100-0159 - sheet2... and so on
2017-07-05 Batch Yield Report 2300-2359 (last file) - sheet25
I'm currently running loop directory but only copy the data into sheet1 and for whatever reason when past the date onto column B (master file) changes the date format.
Could someone please help.
attached are some files for better explanation, "master" file shows how do I need the data to be pasted.
Thanks in advance.
R
 

Attachments

  • Master.xlsm
    169.1 KB · Views: 3
  • 2017-07-04 Batch Yield Report 0600-0659.txt
    11 KB · Views: 1
  • 2017-07-04 Batch Yield Report 0700-0759.txt
    5.3 KB · Views: 1
  • 2017-07-04 Batch Yield Report 0800-0859.txt
    3.9 KB · Views: 1
  • 2017-07-05 Batch Yield Report 2300-2359.txt
    1.5 KB · Views: 0
Monty
Thank you so much for your help.
It comes up with syntax error on
Code:
If .Show <> -1 Then GoTo AllGood
            DirPath = .SelectedItems(1) & "\"

Could you please help me?
Thanks again.
 

Attachments

  • Master.xlsm
    23.4 KB · Views: 1
Back
Top