Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
Danielle HR
 
Posts: n/a
Default list all worksheets in a workbook w/o manually typing

I want to create a list of all the worksheets in one workbook, "table of
contents". The table of contents for a report - basically listing all
departments (that's what the tabs are)

I know there is an indexing function, but I don't know how to use it for
indexing or listing worksheets.
  #2   Report Post  
Posted to microsoft.public.excel.setup
Paul B
 
Posts: n/a
Default list all worksheets in a workbook w/o manually typing

Danielle, here is one way, you might also want to have a look here

http://www.mvps.org/dmcritchie/excel/buildtoc.htm

Sub TOC()
'will add a sheet, name it Worksheet Names
'and list all sheets in the workbook
Dim ws As Worksheet, n As Integer
n = 2
With Worksheets.Add
.Name = "Worksheet Names"
.Move befo=Worksheets(1)
End With
For Each ws In ActiveWorkbook.Worksheets
If ws.Name < "Worksheet Names" Then
Sheets("worksheet Names").Range("a" & n) = ws.Name
n = n + 1
End If
Next
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Danielle HR" <Danielle HR @discussions.microsoft.com wrote in message
...
I want to create a list of all the worksheets in one workbook, "table of
contents". The table of contents for a report - basically listing all
departments (that's what the tabs are)

I know there is an indexing function, but I don't know how to use it for
indexing or listing worksheets.



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
Protecting all worksheets of a workbook neeraj Excel Discussion (Misc queries) 14 May 30th 06 09:46 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Appending external worksheets into existing workbook? Xuratoth Links and Linking in Excel 5 October 4th 05 12:48 PM
How do I build a workbook from the worksheets another workbook? Rico Excel Discussion (Misc queries) 4 August 19th 05 02:04 PM
How do I sum values from different worksheets within one workbook. master gardener Excel Worksheet Functions 1 January 28th 05 07:19 PM


All times are GMT +1. The time now is 10:35 PM.

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"