ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generic Window Activate (https://www.excelbanter.com/excel-programming/293461-generic-window-activate.html)

michael

Generic Window Activate
 
Hi! I was wondering how to activate the nonactive workbook
open in Excel without naming it explicitly? For instance,
I would like to say Activeworkbooks(generic).activate
instead of Activeworkbooks("July ROI").activate

Thank you so much!

Michael

Bob Phillips[_6_]

Generic Window Activate
 
Michael,

You could try something like

For Each owb In Workbooks
If owb.Name < ActiveWorkbook.Name Then
owb.Activate
End If
Next owb

but couldn't there be more than one?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Michael" wrote in message
...
Hi! I was wondering how to activate the nonactive workbook
open in Excel without naming it explicitly? For instance,
I would like to say Activeworkbooks(generic).activate
instead of Activeworkbooks("July ROI").activate

Thank you so much!

Michael




Vasant Nanavati

Generic Window Activate
 
If there are only 2 windows (including hidden ones):

Windows((ActiveWindow.Index Mod 2)+1).Activate

--

Vasant


"Michael" wrote in message
...
Hi! I was wondering how to activate the nonactive workbook
open in Excel without naming it explicitly? For instance,
I would like to say Activeworkbooks(generic).activate
instead of Activeworkbooks("July ROI").activate

Thank you so much!

Michael




Dick Kusleika[_3_]

Generic Window Activate
 
Michael

Also look at the ActivateNext and ActivatePrevious methods of the Window
object, e.g.

ActiveWindow.ActivateNext

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
If there are only 2 windows (including hidden ones):

Windows((ActiveWindow.Index Mod 2)+1).Activate

--

Vasant


"Michael" wrote in message
...
Hi! I was wondering how to activate the nonactive workbook
open in Excel without naming it explicitly? For instance,
I would like to say Activeworkbooks(generic).activate
instead of Activeworkbooks("July ROI").activate

Thank you so much!

Michael







All times are GMT +1. The time now is 04:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com