Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to: Open closed workbook/Search data tables/Return data to open workbook Hugh Adams Excel Discussion (Misc queries) 0 August 18th 10 02:04 PM
how do i open a data workbook when i open a timesheet workbook [email protected] uk Excel Discussion (Misc queries) 2 January 4th 09 04:50 PM
selecting several open worksheets Annette Excel Discussion (Misc queries) 8 September 2nd 08 11:03 PM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
selecting multiple sheet tabs and open another workbook Bannor Excel Discussion (Misc queries) 5 November 25th 05 02:38 AM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"