Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieve Index of Activeworkbook?
This seems easy, but I'm not seeing it.
How do you retrieve the index of the workbooks collection which applies the activeworkbook? I guess one way would be to run through the Workbooks collection looking to see if workbooks(i).name = activeworkbook.name Is there a better way? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieve Index of Activeworkbook?
Don't know is this is what you want, but try it...
Dim x As Long, wbn As String, wb As Workbook For Each wb In Application.Workbooks x = Application.Windows(wb.Name).Index wbn = wb.Name Next you could change wb.Name to Activeworkbook.Name -- steveB Remove "AYN" from email to respond "mark" wrote in message ... This seems easy, but I'm not seeing it. How do you retrieve the index of the workbooks collection which applies the activeworkbook? I guess one way would be to run through the Workbooks collection looking to see if workbooks(i).name = activeworkbook.name Is there a better way? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieve Index of Activeworkbook?
Hello Mark, A Collection Object has both an Index and a Key Value associated with a stored value. Unfortunataley, the object class doesn't support returning the index by using the key value or vice versa. The only option you have is to use a loop to go through the index numbers and compare the name property to the ActiveWorkbook Name. Sincerly, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=378245 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Retrieve Index of Activeworkbook?
The only option you have is to use a loop to go through the index numbers
and compare the name property to the ActiveWorkbook Name. Okay, thanks, Leith. As you saw, that was the option that I thought of as I was posting the question... guess that's the answer. Rahmat ('thank you', in Kyrgyz). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using 3 tables in one spreadsheet and utilising index formula to retrieve information | Excel Worksheet Functions | |||
Retrieve Row index number | Excel Discussion (Misc queries) | |||
retrieve column index... | Excel Discussion (Misc queries) | |||
ActiveWorkBook | Excel Discussion (Misc queries) | |||
How to retrieve index of workbooks | Excel Programming |