ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   moving between windows (https://www.excelbanter.com/excel-programming/380139-moving-between-windows.html)

Hawkdriver

moving between windows
 
When I have multiple worksheets open, lets say (3) and they are arranged
horizontaly so you can see all 3, how does VB move between each worksheet and
how does it relate to the sheets position? If I cannot use a name or date to
differentiate between them what is their order? and does it matter if the
macro is local to one of the sheets or can it be in the "personal"sheet?


[email protected]

moving between windows
 
Do you mean you have multiple workbooks open, each with multiple
worksheets ?
Or that you have multiple windows of the same workbook ?

If the former, you need to work with the WorkBooks collection. There
will be "WorkBooks.Count" workbooks open, indexed in the order they
were opened. Each will have "Workbook(i).Worksheets.Count" worksheets.

If the latter, then you need to work with the Windows collection.
Windows(1) is always the ActiveWindow. You can use Windows(i).Caption
to identify which you want.

NickHK

Hawkdriver wrote:
When I have multiple worksheets open, lets say (3) and they are arranged
horizontaly so you can see all 3, how does VB move between each worksheet and
how does it relate to the sheets position? If I cannot use a name or date to
differentiate between them what is their order? and does it matter if the
macro is local to one of the sheets or can it be in the "personal"sheet?




All times are GMT +1. The time now is 03:35 AM.

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