PDA

View Full Version : Copy ranges



desonny
01-03-2012, 03:41 AM
Hi,

I am quite new in VBA.
Would like to write a code in an excel-module that copies a range from an external excel-file to another external excel-file.

Is this possible ?

Greetz !

Bob Phillips
01-03-2012, 04:51 AM
What do yu mean by an external excel file?

Have you tried doing it with the macro recorder?

desonny
01-03-2012, 05:01 AM
Hi,

I don't think it's possible to do it with a recorded macro, because the external excel files have variable names.
The names of the external files are in a format as : test v1.xls, test v2.xls...
I want to copy data from the previous version into the new version.

Regards,

Sonny

Bob Phillips
01-03-2012, 06:20 AM
Record a macro, and then just change the hard-coded names to your variables. You would have to open the files, copy and paste, then close them. The recorder will give you a great start, if you get stuck then you will have something we can assist you with.