Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Copy data between 2 instances of Excel
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 |
#2
|
|||
|
|||
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...o&userid=19953 View this thread: http://www.excelforum.com/showthread...hreadid=345847 |
#3
|
|||
|
|||
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").co py 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 . |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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 . |
#6
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a list in excel that contains external data? | Excel Discussion (Misc queries) | |||
How do i copy columns of data in notepad into microsoft excel? | New Users to Excel | |||
Lookup Access data in Excel | Excel Worksheet Functions | |||
stop excel from shifting cells up when a query returns no data | Excel Worksheet Functions | |||
getting data from 2 excel sheets automatically | Excel Worksheet Functions |