Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Copy worksheet to another file

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 301
Default Copy worksheet to another file

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.Ro ws.Count,
Cells.Columns.Count - 18).Copy
Workbooks("Book5").Sheets(1).Range("R1").PasteSpec ial
Bob Umlas
Excel MVP


"AlanW" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Copy worksheet to another file

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.

"AlanW" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Copy worksheet to another file

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
"AlanW" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a worksheet from one file to another [email protected] Excel Discussion (Misc queries) 1 May 15th 08 03:48 AM
copy part of a worksheet into a worksheet in the same file/keepi. JTB Excel Worksheet Functions 1 September 23rd 06 09:13 AM
Copy Worksheet from another file Steve Excel Programming 2 August 5th 06 05:27 PM
Copy File into Worksheet Session101[_2_] Excel Programming 1 March 29th 06 03:21 PM
copy a worksheet to another xls file Jac[_2_] Excel Programming 2 November 30th 03 05:13 PM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"