PDA

View Full Version : Combine over 100 workbooks into a single workbook



rorton
09-18-2012, 12:59 PM
I have about 140 workbooks that I need to combine into a single workbook so I can import into a SQL database table. I can make all of the headers/columns match if needed ( some have 10,11 and 6 columns). Is there a easy to run macro I can run to do this?

GTO
09-19-2012, 04:08 AM
I have about 140 workbooks that I need to combine into a single workbook so I can import into a SQL database table. I can make all of the headers/columns match if needed ( some have 10,11 and 6 columns). Is there a easy to run macro I can run to do this?

Greetings rorton and welcome to vbaexpress:hi:

This ia a great site and there are some awfully fine folks here who will go out of their way to help you conquer some bit of vba or formula. Heck, I've seen some scarily impressive bits of using DOS and API and just all sorts of neat stuff here. I am quite sure that you'll be mighty glad you joined!

That said, I hope that you'll take this in the spirit intended:
You have 140+/- workbooks. Where? In the same folder?
Is the source data on the same named sheet in each? -OR- Are the source workbooks each only single sheet workbooks?
Etc...

I would suggest attaching a workbook with several representative worksheets and explaining the logic of how we identiyfy the sheets and which ranges we want to snatch up to the destination.

Hope that helps a little at least :dunno

Mark

rorton
09-19-2012, 06:19 AM
They are all in a total of 10 folders but can easily be moved to a sigle directory. There is a common header for the 11 columns in the workbooks. Some may have 1 row others may have up to 700 rows in a workbook. Due to it being sensative military material I cannot post an example.

snelson
01-22-2013, 02:27 PM
Try KB# 829 'Combine all workbooks into one', it works great!

There is also one that will take all the sheets this one creates and puts them into one 'Master' sheet in KB# 151 'Combine all worksheets into one. All your columns do need to match for this one.

Hope this helps.