Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2004

Tip: Looking for answers? Try searching our database.

worksheet names

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shank - 06 Oct 2004 04:07 GMT
Is it possible to create a list of the worksheet names within the same file?
I received a file that has 40 worksheets.
I need those 40 names in a text list.
Is there a better way than cut-n-pasting?
thanks
Max - 06 Oct 2004 05:10 GMT
One way .. Try the sub below:

Press Alt+F11 to go to VBE
Click Insert > Module
Copy > paste everything within the dotted lines below
into the whitespace on the right

-------begin vba-----
Sub SheetNames()
'Peo Sjoblom in .worksheet.functions Jul '02
   Dim wkSht As Worksheet
   Range("A1").Select
   For Each wkSht In Worksheets
      Selection = wkSht.Name
      ActiveCell.Offset(rowOffset:=1, columnOffset:=0).Activate
   Next wkSht
End Sub
-------endvba------

Press Alt+Q to get back to Excel

In a *new* sheet, press Alt+F8
Select "SheetNames" > Run

The sheetnames will be listed in A1 down, in this sequence:

1st sheet (leftmost) will be listed in A1,
2nd sheet in A2, and so on

Hidden sheets will also be listed
and will appear after the last (rightmost) sheet

Signature

--
Rgds
Max
xl 97
---
Please respond in thread
xdemechanik <at>yahoo<dot>com
----

> Is it possible to create a list of the worksheet names within the same file?
> I received a file that has 40 worksheets.
> I need those 40 names in a text list.
> Is there a better way than cut-n-pasting?
> thanks
JE McGimpsey - 06 Oct 2004 13:58 GMT
For a method that adds hyperlinks to each sheet, take a look at David
McRitchie's BuildTOC macro:

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

> Is it possible to create a list of the worksheet names within the same file?
> I received a file that has 40 worksheets.
> I need those 40 names in a text list.
> Is there a better way than cut-n-pasting?
> thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.