Hi
I am new to VB
I have a folder containing mutiple files for the month of December, each are dated for each day eg 12.01.12
Is there a way of opening each file and copying the information (from Sheet1) into one master file within the folder
Hi
I am new to VB
I have a folder containing mutiple files for the month of December, each are dated for each day eg 12.01.12
Is there a way of opening each file and copying the information (from Sheet1) into one master file within the folder
Welcome to the Forum!
Yes, that's possible. To provide further details, can you describe how the data is to be copied into the master file? That is, do you want each Sheet1 from each individual file to be copied to a separate worksheet in the master? Or are they all stacked up somehow in the worksheet in the Master?
I'm assuming this is strictly a copy & paste, and you don't need to do any of analysis or aggregation of the data.
Jeff
| | |·| |·| |·| |·| | |:| | |·| |·|
Read the rules
Use code tags to [code]enclose your code![/code]
Hi
Glad to join, thanks for helping
I have a master folder containing files all dated for example december .(I would like code I could reuse in each months folder, if that is possible)
Each Sheet1 from each individual file , in this case 20 files , to be copied to a new separate worksheet (called master) that would list all the information from the 20 files on one sheet within the folder
It is strictly copying the data from the multiple files (all the same format) and pasting to one file
Does that help?
Last edited by ingwingfingerling; 12-21-2012 at 11:01 AM.
Attached is a solution where the contents of each worksheet is pasted below the contents of the previous. Push the button and a separate master file will be created. After all content has been added, the master file is left open and you will to manually save it.
File removed, see correction below
Last edited by 6StringJazzer; 12-21-2012 at 05:45 PM. Reason: File removed, see correction below
Thanks
I get an error
Compile error : Variable not defined
Any ideas what I might be doing wrong?
I'm very sorry, I dropped a colon. I made one small change just after I tested it, and that change had an error in it
See attached.
It works with one small error
It copies on the master across the columns
If it could copy the files (without the header) below the columns
Sorry for not being clear
Thanks for your help so far!
It is so important to provide a complete description from the beginning.
This solution copies the first file, and pastes it starting at A1 of the master.
It copies the second file, then pastes it starting in column A, in the row after the end of the data from the first file.
And so on.
How is that copying "on the master across the columns"? It is pasting downwards. What does it mean to copy "(without the header) below the columns"? A column is cells of data; there is no such thing as below a column.
I suggest you build a master by hand by copying and pasting just two files, and then attach all three files so I can see exactly what you want the result to look like.
Based on your samples, the only thing you need to change is to exclude the header from the source files when making the master. This version asks you whether you want to include them.
Hi that works great
Thanks for your help and sharing!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks