Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activate new window
Set a reference to the workbook when you create it. In a general Module.
Public NewBook as Workbook Public sub OpenBook() Set NewBook = Workbooks.Add End Sub Public Sub ActivateBook() NewBook.Activate End Sub "cornishbloke" wrote in message ... Hopefully this is a simple question that I can't find the answer for elsewhere... in VBA, how do I activate the most recent new worksheet? I have a macro which opens a new workbook and then later needs to activate this window. Having recorded this using the macro recorder the code is static (e.g. refers to "book1") and won't work again unless I manually change these values to the next new workbook name. Thanks in Advance. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot activate an Addin via the add-ins window in XL 2007 | Excel Discussion (Misc queries) | |||
How to activate (in the Project Explorer window) using VBA | Excel Discussion (Misc queries) | |||
The window opens in a smaller window not full sized window. | Excel Discussion (Misc queries) | |||
Activate Non-Excel Window Through VBA | Excel Programming | |||
How to keep window + form activate together | Excel Programming |