PDA

View Full Version : Help to modify: "Combine All Data From All Worksheets in All Workbooks" (mvidas)



R.Shaw
11-02-2010, 09:26 AM
Hello,


The code quoted in the title addresses very nicely my need to merge data from all worksheets from all workbooks in a specified directory. Of all my searches, this code best approximates full requirement. I am not a code writer, and have only been successful in testing and then modifying code accordingly. I have not been able to modify this code in order to meet the following additional requirements:

the ability to identify a range from which to extract data in each worksheet, in each workbook;
the ability to extract from this range only the rows that have (at least some) data in them, and to subsequently ignore and not merge blank rows;
the ability to specify which sub-folder and which files within that subfolder that must be merged.
My file directory is set up as with a sub-folder named “Statistics” and within this sub-folder are other sub-folders corresponding to the first year of each reporting period (ie. “C:\Volume\Statistics\2000”, “C:\Volume\Statistics\2003”, “C:\Volume\Statistics\2007”, etc.). I would need the code to point to “C:\Volume\Statistics” in order to allow the ability (i) to pick the sub-folder associated to a specific reporting cycle (e.g. “C:\Volume\Statistics\2007”) and then (ii) to select the files/workbooks contained therein.Each worksheet in each workbook is structured identically. The only differences between the workbooks are that the number of worksheets in each workbook can differ and that the names of the worksheets also differ between workbooks.

I hope someone can help!

Thank-you.

mdmackillop
11-03-2010, 01:41 AM
Can you post a sample workbook? Use Manage Attachments in Go Advanced reply section.