View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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