Copy worksheet to another file

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

Guest

I want to copy a worksheet from File A to the cell "R1" of a worksheet in
File B by using VBA. Could someone please show me the way.

Thank you.
 
You can't copy a worksheet to a cell. You copy cells to cells, worksheets to
worksheets. If you want to copy all the cells in a worksheet to another
worksheet beginning in R1, it's possible, but you no longer have all the
columns available. Maybe something like this:
Workbooks("Book6").Sheets(1).Cells.Resize(Cells.Rows.Count,
Cells.Columns.Count - 18).Copy
Workbooks("Book5").Sheets(1).Range("R1").PasteSpecial
Bob Umlas
Excel MVP
 
Excel will not allow you to copy a larger range to a smaller range. If you
want to copy part of File A to a specific area of File B then you must be
sure that the receiving range is equal to or larger than the source range.
The code would be

Sheets("FileA").Range("A1:B5").Copy Sheets("FileB").Range("R1")

Where you would use your actual file names and the actual range to copy.
 
Hello JLGWhiz

What I would like to do is to copy the whole range to a new file starting
from the Cell R1. Could you please show me the whole procedure. By the way,
shall I activate / open the destination file before copying.

Many Thanks
 

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