PC Review


Reply
Thread Tools Rate Thread

Copy worksheet to another file

 
 
=?Utf-8?B?QWxhblc=?=
Guest
Posts: n/a
 
      21st Aug 2007
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 With Quote
 
 
 
 
Bob Umlas
Guest
Posts: n/a
 
      21st Aug 2007
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


"AlanW" <(E-Mail Removed)> wrote in message
news:705F62E9-3D3E-4B2C-8D24-(E-Mail Removed)...
>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 With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      21st Aug 2007
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.

 
Reply With Quote
 
=?Utf-8?B?QWxhblc=?=
Guest
Posts: n/a
 
      22nd Aug 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy worksheet from one file to another JT Microsoft Excel Programming 2 10th Apr 2009 01:43 AM
Copy worksheet from one file to another =?Utf-8?B?cG9rZGJ6?= Microsoft Excel Misc 6 28th Sep 2007 09:23 PM
copy part of a worksheet into a worksheet in the same file/keepi. =?Utf-8?B?SlRC?= Microsoft Excel Worksheet Functions 1 23rd Sep 2006 09:13 AM
Copy Worksheet from another file =?Utf-8?B?U3RldmU=?= Microsoft Excel Programming 2 5th Aug 2006 05:27 PM
copy a worksheet to another xls file Jac Microsoft Excel Programming 2 30th Nov 2003 05:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:06 PM.