View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default finding the index # of a workbooks

This seems like a pretty strange request to me. I don't think I've ever seen
anyone ask to use something like this.

I'm not sure what you're doing, but if you're trying to refer to the workbook
named mountain.xls, then you could use something like:

Dim MtnWkbk as workbook
....

set mtnwkbk = nothing
on error resume next
set mtnwkbk = workbooks("mountain.xls")
on error goto 0

if mtnwkbk is nothing then
msgbox "not open!"
else
'use it anyway you want.
mtnwkbk.worksheets(1).range("A1").value = "hi there"
end if



dstiefe wrote:

I have severl open workbooks..and I want to loop through them

and when i find the one with the name "Mountain" i then want to know the
index number of that workbooks (i.e. what is the reference number of the
workbook)

Thank you


--

Dave Peterson