PDA

View Full Version : Getting data from diferent files in same Folder



pster
05-11-2007, 12:03 PM
Hi everyone,

I'm startin' to use Vba's codes and I have a lot of question about it.

One that I really need at this time is the following:

I have one File that i'm using as a Database of the datas that I want do copy from all Workbooks in the same Folder.
So, i want to get the range "D15:M20" in all files from a Directory that I choose and copy it to the file "Main.xls" (Database's file) and then close those "temporary" files without saving.

I?ve already tryed a lot of Codes from this site, but i cant continue that.

Can anyone help me?

Tks!

Simon Lloyd
05-12-2007, 01:56 AM
Try these links to items in the Kb:
http://vbaexpress.com/kb/getarticle.php?kb_id=773 , this is probably the one you want
http://vbaexpress.com/kb/getarticle.php?kb_id=829
http://vbaexpress.com/kb/getarticle.php?kb_id=828

pster
05-15-2007, 05:13 AM
Hi,

I've already tried those examples you said but i didn't get any succes in customize it.
For example. I chose the first one:
Combine All Data From All Worksheets in All Workbooks in a Specified Directory
but it takes all the datas from all worksheets in the file wich is in a specific folder. What I want is to get the datas from a specific Worksheet.

Can anyone help me?

Tks!

Charlize
05-15-2007, 11:35 AM
How many worksheets do you have in the workbooks that needs to be copied ? If more, what's the name of the sheet that you want this range from ?

And how does those ranges must be placed in the destination sheet 'Main' ? Problably under each other.

mdmackillop
05-15-2007, 12:49 PM
Here's another one (http://www.vbaexpress.com/kb/getarticle.php?kb_id=454) to try.