Worksheet names

J

johnston

How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
J

JLatham

Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.
 
J

johnston

This worked fantastically well. Thank you!

Is there a way to make this available in all my workbooks?

JLatham said:
Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.

johnston said:
How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
M

Mike

You can put the code that JLatham provided you into a Module in your
Personal .xls workbook and this would allow you to run the code in any
workbook.

Hope this helps

johnston said:
This worked fantastically well. Thank you!

Is there a way to make this available in all my workbooks?

JLatham said:
Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.

johnston said:
How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
G

Gord Dibben

Store Jerry's macro and others you create and copy in your Personal.xls file
so's they are available for all open workbooks.

See help for more on Personal Macro Workbook.


Gord Dibben MS Excel MVP

This worked fantastically well. Thank you!

Is there a way to make this available in all my workbooks?

JLatham said:
Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.

johnston said:
How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
J

johnston

Mike, thank you. I'm learning.

Mike said:
You can put the code that JLatham provided you into a Module in your
Personal .xls workbook and this would allow you to run the code in any
workbook.

Hope this helps

johnston said:
This worked fantastically well. Thank you!

Is there a way to make this available in all my workbooks?

JLatham said:
Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.

:

How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
J

johnston

Gord,

Thank you for the extra tip.

Johnston
Gord Dibben said:
Store Jerry's macro and others you create and copy in your Personal.xls file
so's they are available for all open workbooks.

See help for more on Personal Macro Workbook.


Gord Dibben MS Excel MVP

This worked fantastically well. Thank you!

Is there a way to make this available in all my workbooks?

JLatham said:
Choose an empty sheet in the workbook and run this code:

Sub ListSheetNames()
Dim anySheet As Worksheet

Range("A1").Select
For Each anySheet in Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub

To put the code where you can use it, press [Alt]+[F11] then choose Insert |
Module from the VB Editor menu. Cut and paste that code into the module and
then close the VB Editor and use Tools | Macro | Macros to choose and [Run]
the code.

:

How can I generate a list of the names of the worksheets in a workbook so
that I can write a brief description of what each does?
 
Top