Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Printing a Worksheet List.

Printing a Worksheet List

by Allen Wyatt
(last updated January 16, 2017)


In complex workbooks that contain many worksheets, it is not unusual to need a list of the different worksheets. Once you have the list, you can print it or use it in some other fashion, such as to create a table of contents for your workbook. The following macro, GetSheets, quickly retrieves the names of the worksheets in the current workbook. It places them in the current worksheet, starting at cell A1 and then working downwards.

Sub GetSheets()
    Dim j As Integer
    Dim NumSheets As Integer

    NumSheets = Sheets.Count
    For j = 1 To NumSheets
        Cells(j, 1) = Sheets(j).Name
    Next j
End Sub

This macro will overwrite anything in a cell it needs in the current workbook, so you should make sure you don't need anything in column A of the worksheet. If you don't want to overwrite anything, make sure you create a new worksheet and then run the macro from that worksheet.

Once the list of worksheets is created, you can format it as desired, and then print it out.


If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2216) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Printing a Worksheet List.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Table Borders Won't Print

Print a table and you may be surprised if it has no borders. That could be because you actually have the borders turned ...

Discover More

Uncovering and Removing Links

Excel allows you to reference data in other workbooks by establishing links to that data. If you later want to get rid of ...

Discover More

Table Header Rows after a Manual Page Break

Insert a manual page break into the middle of a table, and you may find that subsequent pages of the table don't always ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (menu)

Printing Selected Worksheets

When you accumulate quite a few workbooks in folder, you might need to print out selected worksheets from all of the ...

Discover More

Printing Limited Pages from a Range of Worksheets

Need to print just a few pages from a group of worksheets? The easiest way to handle the task may be through a macro, as ...

Discover More

Automatically Printing a Range

If you want to automatically print a particular area of your worksheet at a specific time of day, you'll love this tip. ...

Discover More

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 + 0?

2016-07-17 05:29:28



There are two different threads covering your topic. May I suggest looking at these threads as a starting point for what you want to do.

2016-07-16 14:01:36

Peter Ellison

Hi thanks, this works perfectly.

Is there anyway of doing the opposite? Having a list of titles and then using code to insert the automatically into worksheet title tab?

2016-05-17 02:12:00


i read 8 of these before i came across this one and it was the easiest by far.
Thank you

2015-06-05 14:52:38

KJ Freeman

You are my HERO today!!
Thank you!!!!

2015-01-29 15:11:09


Thanks for all the updates and info. Great work.

2015-01-28 06:22:54

Dave K


I put the VBA code from the Mr. Excel site into my PERSONAL.XLSB and assigned a shortcut key. It works a treat!

Thanks for sharing the information.

2015-01-27 11:34:30

Willy Vanhaelen

You will find the answer here:

2015-01-27 07:13:34

Dave K

@Willy Vanhaelen

Willy, this is a wonderful bit of code! Many thanks for your help.

By any chance would you know how to fix a small problem? I am using Office 2010 on Windows 7 Enterprise. When I create a hyperlink, either manually or using your macro, I must use the mouse to click on the link to go to the destination. Previously, in Excel 97, I merely had to go to the cell containing the link and press Enter or Return to get there.

Any ideas how I can get the Enter/Return key to work in 2010?

2015-01-26 10:27:02

Willy Vanhaelen

@Charles Harris: Here it is:

Sub MakeHyperlinkIndex()
Dim ndx As Worksheet, X As Integer
Set ndx = Sheets.Add(before:=Sheets(1))
ndx.Name = "Index"
ndx.Cells(1) = "Worksheets"
For X = 2 To Worksheets.Count
ndx.Hyperlinks.Add _
Anchor:=ndx.Cells(X, 1), Address:="", _
SubAddress:="'" & Worksheets(X).Name & "'!A1", _
Next X
End Sub

The macro creates a new worksheet to deal with the overwriting risk.
Refer to Barry Fitzpatrick's macro (4 Dec 2013) if you want to avoid an error when the sheet already exists.

2015-01-26 04:33:55

Dave K


Here is a small change to my code which will give you a solution. While it's not quite what you want, it works. I don't yet know how to insert a proper hyperlink.

The code produces a list of sheets as before, but each entry is a formula-based link to Cell A1 of the other sheets. If you put the sheet name into Cell A1 of each sheet, then you get a meaningful list. Double-click on the sheet name in the list just created and you will be brought to that sheet.

1. The code Cells(1, 1) refers to Cell A1. Change the Row and Column values if you prefer to have your sheet names elsewhere.

2. You will need to uncheck the option to "Edit directly in cells" for the double-click to work.

3. The screenupdating setting stops the flicker when Excel selects each sheet in the workbook.

4. I would recommend that you include a check to make sure that existing data is not over-written, for example by not properly selecting a blank column before you run the macro.

Anyway, here is my amended code.

Sub InsertLinks()
Dim j As Integer
Dim NS As Integer
Dim C As Integer
Dim sht As Worksheet
NS = Sheets.Count
C = ActiveCell.Column
Set sht = ActiveSheet

Application.ScreenUpdating = False
For j = 1 To NS
Cells(1, 1).Select
Cells(j, C).Select
ActiveSheet.Paste link:=True
Next j
Application.ScreenUpdating = True
End Sub

2015-01-23 20:27:39

Charles Harris


With code dated 8 Oct 2012 is it possible to make the list with each item hyper linked to the specific sheet ?


2013-12-05 06:16:34

Dave Kerr

Thanks for the tip about the sheet numbers. I didn't know how Excel handled them.
Neat solution too, thanks.

2013-12-04 05:59:44

Barry Fitzpatrick

Here's an alternative that adds a sheet and names it "Sheet Names" to avoid any overwriting issues:

Sub List_of_Sheet_Names()

Dim Number_of_Sheets As Integer
Dim Row As Integer
Dim Column As Integer
Dim j As Integer
Dim shtList As Worksheet

'Delete an existing sheet named "Sheet Names"
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Sheet Names").Delete
Application.DisplayAlerts = True
On Error GoTo 0

'create and name a new sheet, and position it at the far left
Set shtList = Worksheets.Add(Before:=Sheets(1))
shtList.Name = "Sheet Names"

Number_of_Sheets = Sheets.Count
'make the list of sheet names
For j = 2 To Number_of_Sheets
shtList.Cells(j - 1, 1) = Sheets(j).Name
Next j

End Sub

NB if there is already a sheet named "Sheet Names" (e.g. if you've run the macro once already). then it will be deleted.

Note also the use of the "Before" parameter. This is because Excel sheet index number is in the order of the sheet tabs on the workbook itself i.e. the leftmost sheet tabs has index 1. The "Before" parameter positions the new sheet at the far left and so is not listed in the list of worksheets.

2013-12-04 05:57:05

Dave Kerr

I went a little further and had the macro check that there are no currently filled cells in the range about to be occupied by the listing.

Excluding the declaration of variables, which should be fairly apparent, here is the code that I use now. It works well for me.

NS = Sheets.Count
R = ActiveCell.Row
C = ActiveCell.Column
NonBlank = 0

For j = 1 To NS
If Cells(R, C) <> "" Then
NonBlank = NonBlank + 1
End If
R = R + 1
Next j

R = ActiveCell.Row

If NonBlank > 0 Then
MsgBox "This process will over-write existing cells." & vbCrLf & _
"Please select an area of blank cells and re-start." & vbCrLf & _
"Click OK to stop."
Exit Sub
For j = 1 To NS
Cells(R, C).NumberFormat = "@"
Cells(R, C) = Sheets(j).Name
R = R + 1
Next j
End If

I hope this helps!

2013-12-03 08:33:56


Thanks for this. Its just the start I needed to get what I want!

Altered it slightly and now the macro inserts the list of worksheets in the cell you pick.

Sub List_of_Sheet_Names()

Dim Number_of_Sheets As Integer
Dim Row As Integer
Dim Column As Integer
Dim j As Integer

Number_of_Sheets = Sheets.Count
Row = ActiveCell.Row
Column = ActiveCell.Column

For j = 1 To Number_of_Sheets
Cells(Row, Column) = Sheets(j).Name
Row = Row + 1
Next j

End Sub

2012-10-08 05:10:58

Barry Fitzpatrick

I would recommend in both of the above examples to clearing the column that will be used to store the sheet names, because if there is already data in the column that doesn't get overwritten by the macro then it will appear that there are more sheets than there actually are. Any subject macro where it to use the data in the column would give a run time error as it wouldn't be able to find the sheets at the end of the list (i.e. those entries that were not overwritten).

2012-10-08 03:33:58

Dave K

Brilliant in its simplicity. Just add two lines and make one small change if you want to decide which column to use, as follows.

Sub GetSheets()
Dim j As Integer
Dim NS As Integer
Dim C As Integer

NS = Sheets.Count
C = ActiveCell.Column

For j = 1 To NS
Cells(j, C) = Sheets(j).Name
Next j

End Sub

Before you run the macro, select any cell in the column where you want the list to appear. The column value from ActiveCell is assigned to the variable C and used in the positioning loop.

This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.