Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default List sheet names

Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default List sheet names

Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True: ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:
Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default List sheet names

Works fantastic, thanks very much !!!!

Will have a look at your website, for some more hints and tips.

Regards,
Steven

"somethinglikeant" wrote:

Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True: ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:
Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default List sheet names

This is great, it works fantastically well. Thanks.

I will have a look at your website for some more hints and tips.

Regards,
Steven

"somethinglikeant" wrote:

Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True: ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:
Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default List sheet names

Hi somethinglikeant;
Stepped through your code mostly to see the "affect" of
The two ":"'s in line 2 and 3. Noted that they serve
To act as Separators or parameters; just hadn't noticed
This before being faily new to all this. Can you comment
On their use/purpose, or have I guessed correctly?
TIA,


"somethinglikeant" wrote in message
oups.com:

Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True: ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:

Hi there,

Can anybody help me with the code the generate a list of all the sheet names
in my workbook.

Preferably the code should create a new sheet in the workbook and then list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default List sheet names

Don't practice it Jim, it makes the code harder to read IMO.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Jim May" wrote in message
news:1b3zg.105279$IZ2.40215@dukeread07...
Thanks Don;

"Don Guillett" wrote in message
:

just lets you put several lines on one line
a
b
c
a:b:c

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:0n2zg.105277$IZ2.198@dukeread07...

Hi somethinglikeant;
Stepped through your code mostly to see the "affect" of
The two ":"'s in line 2 and 3. Noted that they serve
To act as Separators or parameters; just hadn't noticed
This before being faily new to all this. Can you comment
On their use/purpose, or have I guessed correctly?
TIA,


"somethinglikeant" wrote in message
oups.com:


Hi Steven this should do it

Sub ListSheets()
Sheets.Add after:=Sheets(Sheets.Count): ActiveSheet.Name = "Sheet
Names"
[A1] = "Sheet Names": ActiveCell.Font.Bold = True:

ActiveCell.Offset(1,
0).Select
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name < "Sheet Names" Then
ActiveCell = sht.Name
ActiveCell.Offset(1, 0).Select
End If
Next sht
End Sub

http://www.excel-ant.co.uk




StevenP wrote:


Hi there,

Can anybody help me with the code the generate a list of all the

sheet
names
in my workbook.

Preferably the code should create a new sheet in the workbook and

then
list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default List sheet names

You may find this to be more efficient for your list

Sub listsheets()
For i = 1 To Worksheets.Count
Cells(i, "a") = Sheets(i).Name
Next i
End Sub



--
Don Guillett
SalesAid Software

"StevenP" wrote in message
...
Hi there,

Can anybody help me with the code the generate a list of all the sheet
names
in my workbook.

Preferably the code should create a new sheet in the workbook and then
list
all the names starting in cell A1, going down.

Thanks for the help.

Regards,

Steven P



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
how do i set up a list of names on a sheet frm various sheets in e mcvities_69 Excel Discussion (Misc queries) 1 January 27th 06 02:51 AM
Putting Sheet Names on a list arcq Excel Programming 3 March 9th 05 02:49 PM
Creating list of sheet names trickdos[_14_] Excel Programming 0 September 29th 04 07:26 PM
Creating list of sheet names trickdos[_13_] Excel Programming 1 September 29th 04 07:10 PM
VBA to insert list of sheet names Katherine Vale Excel Programming 4 September 1st 03 07:12 PM


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