Finding a Worksheet to Unhide among Many Hidden Sheets

Written by Allen Wyatt (last updated February 3, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365


1

Steve has a workbook in which he creates a new worksheet tab for each project he works on. To keep things manageable, he hides the completed tabs/projects. Steve now has 100+ hidden worksheets. On a regular basis he has a need to revisit a completed project. To do this, Steve chooses to unhide worksheets. This displays the Unhide dialog box which contains the hidden worksheet names, in no apparent order. To find a tab/project, he needs to scroll through this very small dialog box and look for the right tab. Steve finds this very laborious and time-consuming, so he is wondering if there is a a better way to find and unhide the worksheet for a completed project.

One solution to this all-too-common problem is that you could create an index or table of contents for the worksheets in your workbook. You do this by adding a new worksheet and then putting hyperlinks on the worksheet to all the various worksheets in your workbook. It could include just about any information you want about the worksheets (in addition to the hyperlink). Click the hyperlink and your desired worksheet is displayed, without the need of scrolling through any dialog boxes.

You could also create a second workbook that contains just your completed projects. It is quite easy to move worksheets from one workbook to another, so using two workbooks ("active" and "completed") would be a snap. Plus, you wouldn't need to hide any of the worksheets in the workbook containing the completed projects, and you could put them in any order desired.

If you prefer to keep your workbook as is, then you may want to consider creating a macro that would make displaying your hidden worksheets a snap. Consider the following example:

Sub UnHideWorksheets()
    Dim sSheetName As String
    Dim w As Worksheet
    Dim sTemp As String

    sTemp = "Name (or partial) of sheet to show?"
    sSheetName = InputBox(sTemp, "Show Hidden Sheet")
    If sSheetName > "" Then
        sSheetName = LCase(sSheetName)
        For Each w In Sheets
            w.Tab.ColorIndex = xlColorIndexNone
            If w.Visible = False Then
                sTemp = LCase(w.Name)
                If Instr(sTemp, sSheetName) Then
                    w.Visible = True
                    w.Tab.ColorIndex = 6
                End If
            End If
        Next w
    End If
End Sub

The macro asks the user for a worksheet name, and then steps through all the worksheets. If it finds a hidden worksheet and the worksheet's name matches, then the worksheet is displayed and the color of the worksheet's tab is set to yellow. The macro actually works with partial matches, meaning that you can enter just a part of a worksheet name, and any hidden worksheets that contain the partial match will be unhidden. You could easily assign the macro to a shortcut key or your Quick Access Toolbar so you could call it into action in a snap.

Note:

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 (13589) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, and Excel in Microsoft 365.

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. ...

MORE FROM ALLEN

Making Word Stop at the End of a Document when Reviewing Changes

The Track Changes tool is a great help when you want to see what edits have been made to a document. When you review ...

Discover More

Displaying a Result as Minutes and Seconds

When you use a formula to come up with a result that you want displayed as a time, it can be tricky figuring out how to ...

Discover More

Space after a Table

Those familiar with styles are used to setting vertical spacing before or after paragraphs. You can get just the look you ...

Discover More

Best-Selling VBA Tutorial for Beginners Take your Excel knowledge to the next level. With a little background in VBA programming, you can go well beyond basic spreadsheets and functions. Use macros to reduce errors, save time, and integrate with other Microsoft applications. Fully updated for the latest version of Office 365. Check out Microsoft 365 Excel VBA Programming For Dummies today!

More ExcelTips (ribbon)

Lotus Grouped Worksheets

Not all spreadsheet programs are created equal; there are some things that can be done in others that can't be done in ...

Discover More

Quickly Inserting a New Worksheet

Want a quick way to insert a worksheet? There's nothing faster than using the handy shortcut.

Discover More

Copying a Single Cell to Multiple Worksheets

If you need to copy a cell from one worksheet to a bunch of other worksheets, the work can quickly get tedious. Make the ...

Discover More
Subscribe

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

View most recent newsletter.

Comments

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}] (all 7 characters, in the sequence shown) 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 three more than 3?

2024-02-04 12:18:10

J. Woolley

My Excel Toolbox includes the following function:
    =SheetListUpdateLink([Friendly_Name], [Screen_Tip])
This function uses SuperLink to create a hyperlink that runs a private macro to list/update all the workbook's sheets in subsequent rows (replacing their previous contents). Hidden sheets will have gray fill. Each sheet in the list includes a hyperlink that will hide or unhide the sheet when clicked. If the sheet becomes visible (not hidden), its cell will change to no fill and the sheet will be activated; otherwise, the sheet will be hidden, the cell’s fill will change to gray, and the active sheet will remain the same. Clicking an unhidden sheet's hyperlink twice will first hide then unhide and activate it.
If a sheet is added or deleted or a sheet’s name or visibility is changed, the list of sheets will not automatically update; therefore, it is advisable to click the SheetListUpdateLink function's hyperlink (which updates the list) before using any of the hyperlinks in the list. But remember, necessary rows in the column below the list will be replaced without warning whenever the list is updated.
For more information, review the PDF file UseSheetList.pdf.
See https://sites.google.com/view/MyExcelToolbox


This Site

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.

Newest Tips
Subscribe

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.