Copy file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Try turning on the macro recorder when you do it manually.

You'll see code that works.
 
Back
Top