#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default Sheets names

Hello again. Here is a different one.
How can I produce a list (in one sheet) of all the sheets names in a file?
Is there a function?
Thanks
Petros
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Sheets names

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name
End Function

then in the worksheet enter:

=sheetname(ROWS($A$1:$A1)) and copy down.
--
Gary''s Student - gsnu200771
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 123
Default Sheets names

This macro should solve your purpose.

Sub sheetnames()

RowCount = 1
For Each sht In Sheets
Range("A" & RowCount) = sht.Name
RowCount = RowCount + 1
Next sht

End Sub


Boss


"Gary''s Student" wrote:

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name
End Function

then in the worksheet enter:

=sheetname(ROWS($A$1:$A1)) and copy down.
--
Gary''s Student - gsnu200771

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Sheets names

FWIW,,,
This code is producing the Code (Hidden) Name of the Sheet, Not the
Sheetname the user has access to by renaming with the short-cut menu.
Jim

"Gary''s Student" wrote:

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name
End Function

then in the worksheet enter:

=sheetname(ROWS($A$1:$A1)) and copy down.
--
Gary''s Student - gsnu200771

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Sheets names

I don't think so.

That would be:
sheetname = Sheets(i).CodeName



Jim May wrote:

FWIW,,,
This code is producing the Code (Hidden) Name of the Sheet, Not the
Sheetname the user has access to by renaming with the short-cut menu.
Jim

"Gary''s Student" wrote:

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name
End Function

then in the worksheet enter:

=sheetname(ROWS($A$1:$A1)) and copy down.
--
Gary''s Student - gsnu200771


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 477
Default Sheets names

Good Catch Dave;

Not sure what I did -- the first time -- but,,,
I can't redo.

Jim

"Dave Peterson" wrote:

I don't think so.

That would be:
sheetname = Sheets(i).CodeName



Jim May wrote:

FWIW,,,
This code is producing the Code (Hidden) Name of the Sheet, Not the
Sheetname the user has access to by renaming with the short-cut menu.
Jim

"Gary''s Student" wrote:

First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name
End Function

then in the worksheet enter:

=sheetname(ROWS($A$1:$A1)) and copy down.
--
Gary''s Student - gsnu200771


--

Dave Peterson

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
Two sheets that have the same names but different data want to be Edumois Excel Discussion (Misc queries) 0 July 30th 07 03:16 PM
Cell Names in Two Sheets NHMM Excel Discussion (Misc queries) 5 May 25th 07 11:06 PM
Problem with accessing names across sheets [email protected] Excel Discussion (Misc queries) 1 March 29th 06 01:43 AM
cells and sheets, names PH NEWS Excel Worksheet Functions 3 February 20th 06 03:35 PM
how do i get the names of the sheets Reny J Joseph Thuthikattu Excel Worksheet Functions 1 December 11th 04 09:37 AM


All times are GMT +1. The time now is 01:56 AM.

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"