Copy file

A

AlanW

I have a worksheet in FileA and I want to copy it to the range from R1 to X10
of FileB by using VBA. Could someone please show me the procedures. By the
way, shall I activate / open FileB before copying.

Many Thanks
 
D

Duke Carey

Workbooks("FileA.xls").worksheets("Sheet1").range("R1:X10").copy
Destination:= _
Workbooks("FileB.xls").worksheets("Sheet1").range("R1:X10")

Adjust the first range ("R1:X10") to reflect the range you are actually
copying. Same for both filenames and Sheet names
 
D

Dave Peterson

Try turning on the macro recorder when you do it manually.

You'll see code that works.
 
Top