Hello,
I have 2 windows of Excel with data. The data are
separated (not in one workbook). I would like to copy the
data from one Excel to another via VBA or Macro.
How can I do that ?
Thanks
Hello,
I have 2 windows of Excel with data. The data are
separated (not in one workbook). I would like to copy the
data from one Excel to another via VBA or Macro.
How can I do that ?
Thanks
If you look at the Object Model you'll see that Workbook is a collection. Any open workbook should be part of that collection. So, if you only have these 2 books open you should be able to switch from workbook(1) to workbook(20, using the sheets collection, and the cells collection, ranges, etc to grab the data from one book and copy or move this to the other.
E.g.
Workbooks(1).Sheets("Sheet1).Range("A1:C50").copy
Workbooks(2).Sheets("Sheet1)>Range("A1").Paste
Something like that from memory anyway. use VBA Help for the workbooks collection and you'll get the general idea.
HTH
Art
Hello,
You are right, but my situation is different. I have
two Excel open. If it was one Excel open with two
workbooks you was right. But in my situation - One
Excel doesn't know the other. So I do not have access to
its workbooks.
Thanks anyway... if you have any other solution I
will appreciate if you send it.
Thanks
>-----Original Message-----
>
>If you look at the Object Model you'll see that Workbook
is a
>collection. Any open workbook should be part of that
collection. So, if
>you only have these 2 books open you should be able to
switch from
>workbook(1) to workbook(20, using the sheets collection,
and the cells
>collection, ranges, etc to grab the data from one book
and copy or move
>this to the other.
>
>E.g.
>
>Workbooks(1).Sheets("Sheet1).Range("A1:C50").copy
>Workbooks(2).Sheets("Sheet1)>Range("A1").Paste
>
>Something like that from memory anyway. use VBA Help for
the workbooks
>collection and you'll get the general idea.
>
>HTH
>
>Art
>
>
>--
>HiArt
>---------------------------------------------------------
---------------
>HiArt's Profile: http://www.excelforum.com/member.php
action=getinfo&userid=19953
>View this thread:
http://www.excelforum.com/showthread...hreadid=345847
>
>.
>
Hello Boba-
I'm replying more out of curiosity than anything else, and was wondering why
there are 2 "instances" of Excel running in the first place. I am truly at a
loss as to what benefit this offers. It has always been stressed to me that
this is something to be avoided for numerous reasons, all of which make sense.
If you could more fully explain what your ultimate goal is, perhaps someone
could offer some useful suggestions.
Thanks |:>)
"Boba" wrote:
> Hello,
>
> I have 2 windows of Excel with data. The data are
> separated (not in one workbook). I would like to copy the
> data from one Excel to another via VBA or Macro.
> How can I do that ?
>
> Thanks
>
>
Hello,
You're absolutly right - 2 instances of Excel didn't
make any benefit But in out place there is a software
which have the feature to export the data to Excel via
the automation. I don't have any control on that software.
When I export twice I got two Excels open. Now I have to
comapre the data between them - The question is How can I
do it ?
Thanks.
>-----Original Message-----
>Hello Boba-
>
>I'm replying more out of curiosity than anything else,
and was wondering why
>there are 2 "instances" of Excel running in the first
place. I am truly at a
>loss as to what benefit this offers. It has always been
stressed to me that
>this is something to be avoided for numerous reasons,
all of which make sense.
>
>If you could more fully explain what your ultimate goal
is, perhaps someone
>could offer some useful suggestions.
>
>Thanks |:>)
>
>"Boba" wrote:
>
>> Hello,
>>
>> I have 2 windows of Excel with data. The data are
>> separated (not in one workbook). I would like to copy
the
>> data from one Excel to another via VBA or Macro.
>> How can I do that ?
>>
>> Thanks
>>
>>
>.
>
I would close one instance and open that workbook in the remaining instance.
I could copy and paste between two different instances, but my formulas were
lost. (xl2003/winXP).
Maybe that's not a problem for you.
Boba wrote:
>
> Hello,
>
> You're absolutly right - 2 instances of Excel didn't
> make any benefit But in out place there is a software
> which have the feature to export the data to Excel via
> the automation. I don't have any control on that software.
> When I export twice I got two Excels open. Now I have to
> comapre the data between them - The question is How can I
> do it ?
>
> Thanks.
>
> >-----Original Message-----
> >Hello Boba-
> >
> >I'm replying more out of curiosity than anything else,
> and was wondering why
> >there are 2 "instances" of Excel running in the first
> place. I am truly at a
> >loss as to what benefit this offers. It has always been
> stressed to me that
> >this is something to be avoided for numerous reasons,
> all of which make sense.
> >
> >If you could more fully explain what your ultimate goal
> is, perhaps someone
> >could offer some useful suggestions.
> >
> >Thanks |:>)
> >
> >"Boba" wrote:
> >
> >> Hello,
> >>
> >> I have 2 windows of Excel with data. The data are
> >> separated (not in one workbook). I would like to copy
> the
> >> data from one Excel to another via VBA or Macro.
> >> How can I do that ?
> >>
> >> Thanks
> >>
> >>
> >.
> >
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks