![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 4
|
Hi,
I have recorded a macro that copys data from one workbook to another and it works fine for the books it was recorded in. But I need to use the macro in many other books, all with different names. There must be a line of code that will cause the other open workbook to activate. There will only be two workbooks open and both will have different names each time the macro is needed. I've searched back through the messages to find a similar question. There are some, but I couldn't quite figure them out. I'm very much a beginner at macros. Using Excel 97. Thank you for any help. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi cables
It would not be a problem to determine what two books are currently open, the problem is how do we know which book is calling and which book is sending? Will the procedure only be located in one book? Give some more details and post your code as well... Thanks, Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi, Here is a sample.
We would handle the workbooks by useing window index. If 2 workbooks are opened. An index of Active workbook is 1, another is 2. Please copy this into a standard module of personal.xls.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|