Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How can you get a list of sheetnames?

Hello,

I am trying to get a list of sheetnames or at lesat the first sheet name of
a XSL file.

Thanks in advance for any help,

Jack

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default How can you get a list of sheetnames?

This will put the worksheet names in the IMMEDIATE window

Sub ListWorksheets()
Dim aWS As Worksheet

For Each aWS In ActiveWorkbook.Worksheets
Debug.Print aWS.Name, aWS.CodeName
Next aWS

End Sub

"Jack" wrote:

Hello,

I am trying to get a list of sheetnames or at lesat the first sheet name of
a XSL file.

Thanks in advance for any help,

Jack

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default How can you get a list of sheetnames?

In a standard module:

Sub ListOutSheetNames()
Application.ScreenUpdating = False
Dim Nsheet As Worksheet
Set Nsheet = Sheets.Add
Dim WS As Worksheet
Dim r As Integer
r = 1
For Each WS In Worksheets
If WS.Name < Nsheet.Name Then
Nsheet.Range("A" & r) = WS.Name
r = r + 1
End If
Next WS
Application.DisplayAlerts = False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub




"Jack" wrote in message
:

Hello,

I am trying to get a list of sheetnames or at lesat the first sheet name of
a XSL file.

Thanks in advance for any help,

Jack


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
Sort Sheetnames when names are Months curiosity_killed_the_cat[_2_] Excel Discussion (Misc queries) 10 November 6th 07 12:07 PM
Allow relative referencing for imbedded sheetnames in formulas Ted Excel Worksheet Functions 1 March 8th 06 10:10 PM
how to update Listbox of sheetnames if user changes sheetnames? tr00per Excel Programming 7 February 12th 06 08:03 AM
read sheetnames with ADO farmer[_2_] Excel Programming 6 November 2nd 04 04:25 PM
can we copy the sheetnames too? Martyn Excel Programming 5 May 21st 04 10:52 AM


All times are GMT +1. The time now is 01:31 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"