Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default List the worksheets in a workbook

I want to list the worksheet names in a workbook using the Immediate window.
What should I type in this window to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default List the worksheets in a workbook

? Sheets.Item(2).name

Or you could just write the code to loop the names to the immediate window:

Sub SheetNames()
Dim intSheets As Integer
Dim i As Integer

intSheets = Sheets.Count

For i = 1 To intSheets
Debug.Print Sheets.Item(i).Name
Next

End Sub

Ken


"Kirk P." wrote:

I want to list the worksheet names in a workbook using the Immediate window.
What should I type in this window to do this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default List the worksheets in a workbook

The following compound statement will insert the names of all
worksheets in your active workbook in Column A of the active worksheet.
Note the use of colons (":") to separate statements. Ignore any line
breaks displaying in the newsgroup post.

Range("A1").Select:For x = 1 to
Application.ActiveWorkbook.Sheets.Count:
ActiveCell.Offset(x-1,0).Value=sheets(x).name:Next x

Just a side note: Right-clicking on the sheet navigation arrows on the
bottom left will display a list of all sheet names.

-Glenn Ray

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
Creating a List From Worksheets in a WorkBook Carl Excel Worksheet Functions 1 August 30th 06 09:00 PM
List All Worksheets in Workbook sparx Excel Discussion (Misc queries) 7 February 28th 06 12:44 PM
Summary list of worksheets in workbook [email protected] Excel Discussion (Misc queries) 2 January 25th 06 08:52 PM
Can I print a list of all of the worksheets within a workbook? SRsonn Excel Discussion (Misc queries) 1 June 29th 05 07:16 PM
Can I see a list of the worksheets within a workbook without scro. shrn Excel Worksheet Functions 3 March 26th 05 01:13 AM


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

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"