Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default index and names of open workbooks

Hi Everyone:

In excel, is there a way I can get the index and name of all open workbooks,
and once I have that information, to get the name and index of worksheets on
each book? I would appreciate a sample code. Thanks for your help.

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default index and names of open workbooks

maybe something like this. they will be displayed in the immediate window
Sub test()
Dim wb As Workbook
Dim ws As Worksheet
For Each wb In Application.Workbooks
Debug.Print wb.Name
For Each ws In wb.Worksheets
Debug.Print ws.Name, ws.Index
Next
Next
End Sub

--


Gary


"Bob" wrote in message
...
Hi Everyone:

In excel, is there a way I can get the index and name of all open workbooks,
and once I have that information, to get the name and index of worksheets on
each book? I would appreciate a sample code. Thanks for your help.

Bob




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default index and names of open workbooks

Thank you Garry. That is what I was looking for. By the way, is there a
way of getting the index of the workbooks.

Bob

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
maybe something like this. they will be displayed in the immediate window
Sub test()
Dim wb As Workbook
Dim ws As Worksheet
For Each wb In Application.Workbooks
Debug.Print wb.Name
For Each ws In wb.Worksheets
Debug.Print ws.Name, ws.Index
Next
Next
End Sub

--


Gary


"Bob" wrote in message
...
Hi Everyone:

In excel, is there a way I can get the index and name of all open
workbooks, and once I have that information, to get the name and index of
worksheets on each book? I would appreciate a sample code. Thanks for
your help.

Bob






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
Excel2007; workbooks.count is not counting all open workbooks greg.campeau Excel Programming 2 August 2nd 08 08:37 PM
Find names of all open workbooks Graham Whitehead Excel Programming 2 November 15th 06 02:39 PM
how to open workbooks with different names Kanan Excel Programming 8 May 6th 05 11:28 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
Open workbooks with different names Jako[_10_] Excel Programming 3 May 8th 04 06:09 AM


All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"