PC Review


Reply
Thread Tools Rate Thread

Copy destination = different file / different Workbook

 
 
artisdepartis
Guest
Posts: n/a
 
      14th Mar 2007
Hi All,

How can i set a different Workbook as my destination using the code
below or the .Copy Destination = property (Both when my destination
file is open or even when it is closed...)

I now use:

Worksheets(Sheet2).Range("A1:AA" & LastRow).Value = Range("A1:AA" &
LastRow).Value

But get a 'type mismatch' when I use
Workbooks("macro new
created.xls").Worksheets(Sheet2).Range("A1:AA" & LastRow).Value =
Range("A1:AA" & LastRow).Value

I recorded a macro, but want to try to use the above method due to
memory / speed issues.

Any help would be greatly appreciated, as always!

 
Reply With Quote
 
 
 
 
artisdepartis
Guest
Posts: n/a
 
      14th Mar 2007
To clearify my question: my destination file is open when i run this
macro. (I was just wandering if it needs to be open to work).

On Mar 14, 10:39 am, "artisdepartis" <artispar...@gmail.com> wrote:
> Hi All,
>
> How can i set a different Workbook as my destination using the code
> below or the .Copy Destination = property (Both when my destination
> file is open or even when it is closed...)
>
> I now use:
>
> Worksheets(Sheet2).Range("A1:AA" & LastRow).Value = Range("A1:AA" &
> LastRow).Value
>
> But get a 'type mismatch' when I use
> Workbooks("macro new
> created.xls").Worksheets(Sheet2).Range("A1:AA" & LastRow).Value =
> Range("A1:AA" & LastRow).Value
>
> I recorded a macro, but want to try to use the above method due to
> memory / speed issues.
>
> Any help would be greatly appreciated, as always!



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      14th Mar 2007
The workbooks have to be open.

And if Sheet2 is the name of the worksheet, I think you'll want:

Worksheets("Sheet2").range(....
(with the double quotes)

artisdepartis wrote:
>
> Hi All,
>
> How can i set a different Workbook as my destination using the code
> below or the .Copy Destination = property (Both when my destination
> file is open or even when it is closed...)
>
> I now use:
>
> Worksheets(Sheet2).Range("A1:AA" & LastRow).Value = Range("A1:AA" &
> LastRow).Value
>
> But get a 'type mismatch' when I use
> Workbooks("macro new
> created.xls").Worksheets(Sheet2).Range("A1:AA" & LastRow).Value =
> Range("A1:AA" & LastRow).Value
>
> I recorded a macro, but want to try to use the above method due to
> memory / speed issues.
>
> Any help would be greatly appreciated, as always!


--

Dave Peterson
 
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 Autofilter Source Workbook A result in Destination Workbook BSheet1 u473 Microsoft Excel Programming 1 9th Sep 2008 05:14 PM
Excel-how to link source workbook to copy of destination workbook D Lynn Microsoft Excel Worksheet Functions 1 29th May 2008 05:36 PM
move/copy lost format in destination workbook AGould7 Microsoft Excel Misc 0 18th Dec 2007 02:05 PM
saving workbook to destination file automatically mikespeck Microsoft Excel Worksheet Functions 8 22nd Aug 2006 10:13 PM
how to copy succeeding rows from source workbook to destination w. =?Utf-8?B?Y2hyaXM=?= Microsoft Excel Programming 0 8th Mar 2005 01:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:10 AM.