Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default 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
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
using 3 tables in one spreadsheet and utilising index formula to retrieve information Aaron Hodson \(Coversure\) Excel Worksheet Functions 2 November 5th 07 01:40 PM
Retrieve Row index number loren.pottinger Excel Discussion (Misc queries) 6 August 30th 06 08:07 PM
retrieve column index... Bob Bedford Excel Discussion (Misc queries) 1 May 1st 06 01:22 AM
ActiveWorkBook Pete Excel Discussion (Misc queries) 3 May 9th 05 04:14 PM
How to retrieve index of workbooks Dale[_15_] Excel Programming 2 January 13th 05 04:43 AM


All times are GMT +1. The time now is 07:48 AM.

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"