Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting the other open workbook
Is there code to select the only other open workbook (it
only has one worksheet)? I've written code into one workbook, but the macro will run in another book. Unfortunately, I don't work with Excel-savvy people, and my goal is to make this as simple as possible, so I want to create a button in the workbook with the code...but I don't know how to make the code know to select the other book to run. Any thoughts? Thanks, Karen |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting the other open workbook
Could it be any workbook or will the workbook have a specific name.
It if has a specific name, then you can just reference that workbook. With Workbooks("OtherWorkbookName.xls") .worksheets(1).Range("A1").Value = int(rnd()*100+1) ' and so forth -- Regards, Tom Ogilvy "Karen" wrote in message ... Is there code to select the only other open workbook (it only has one worksheet)? I've written code into one workbook, but the macro will run in another book. Unfortunately, I don't work with Excel-savvy people, and my goal is to make this as simple as possible, so I want to create a button in the workbook with the code...but I don't know how to make the code know to select the other book to run. Any thoughts? Thanks, Karen |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting the other open workbook
No - the other workbook will consistently be changing and
will always have a different name. Is there any way to just designate the other workbook without naming it? It will always be the only other workbook open, and it will always only have one worksheet, so the name is irrelevant. (Or is it?) Thanks, Karen -----Original Message----- Could it be any workbook or will the workbook have a specific name. It if has a specific name, then you can just reference that workbook. With Workbooks("OtherWorkbookName.xls") .worksheets(1).Range("A1").Value = int(rnd()*100+1) ' and so forth -- Regards, Tom Ogilvy "Karen" wrote in message ... Is there code to select the only other open workbook (it only has one worksheet)? I've written code into one workbook, but the macro will run in another book. Unfortunately, I don't work with Excel-savvy people, and my goal is to make this as simple as possible, so I want to create a button in the workbook with the code...but I don't know how to make the code know to select the other book to run. Any thoughts? Thanks, Karen . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to: Open closed workbook/Search data tables/Return data to open workbook | Excel Discussion (Misc queries) | |||
how do i open a data workbook when i open a timesheet workbook | Excel Discussion (Misc queries) | |||
selecting several open worksheets | Excel Discussion (Misc queries) | |||
excel 2003 saved file will not open without a blank workbook open | Excel Discussion (Misc queries) | |||
selecting multiple sheet tabs and open another workbook | Excel Discussion (Misc queries) |