Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Cannot activate an Addin via the add-ins window in XL 2007 [email protected] Excel Discussion (Misc queries) 0 June 3rd 09 02:41 AM
How to activate (in the Project Explorer window) using VBA EagleOne Excel Discussion (Misc queries) 0 December 15th 06 02:26 AM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
Activate Non-Excel Window Through VBA Mark Bigelow Excel Programming 1 September 3rd 03 07:37 PM
How to keep window + form activate together John Brash Excel Programming 1 July 24th 03 10:13 AM


All times are GMT +1. The time now is 02:25 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"