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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top