Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Printing a Worksheet List.
by Allen Wyatt
(last updated August 27, 2016)
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.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12181) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Printing a Worksheet List.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
When you accumulate quite a few workbooks in a folder, you might need to print out selected worksheets from all of the ...Discover More
If you need to modify where a worksheet is printed (meaning, which paper tray it should use), Excel doesn't provide a lot ...Discover More
It is not uncommon to use Excel to print out regular reports. If your report needs to span multiple worksheets, here's ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.