Hide and Unhide Tabs using Drop-down Menus in Excel (UPDATED MAY 2022)
I’d like to share a handy little trick I learned this week for hiding and unhiding tabs in Excel using drop-down menus. Now this method requires you to use some basic VBA code and to save the Workbook as a Macro-Enabled file but don’t be intimidated – no previous coding experience is required to make this work. I’ve recorded a short video tutorial that walks you through the process and included the VBA code you will need below. I’ve also added a download link to the Excel file used in this tutorial.
Why Add this to my Real Estate Model?
If you’ve spent much time working with real estate financial models, you’ve probably come across a model with way too many tabs. Perhaps it’s a portfolio model with tabs for dozens of properties, or a complex DCF with a multitude of behind-the-scenes calculation tabs. Whatever the reason, having a lot of tabs in your model can kill the user experience. This trick will allow you, the creator of the model, to determine which tabs are visible based on criteria selected by the user.
So for instance, imagine you build a portfolio model for up to 30 properties with one tab for each property. You then add a drop-down menu on your summary tab where the user can select the number of properties in the portfolio. If the user selects 12 for example, 12 property tabs are left visible and 18 property tabs are automatically hidden from view. If the user wants to add more properties, she simply chooses more properties from the drop-down menu and the relevant tabs automatically become visible.
Step-by-Step Video Tutorial – Hide and Unhide Worksheets
The VBA Code
Here is a template of the VBA code used in the video. Replace the text in blue with text specific to your model.
Private Sub Worksheet_Change(ByVal Target As Range)
If [CELL NAME] = “SOME VALUE” Then
Sheets(“TAB NAME“).Visible = False
Sheets(“TAB NAME“).Visible = True
This version of the model is only compatible with Excel 2013, Excel 2016, and Excel 365.
Download the Hide And Unhide Tabs Using Drop-Down Menus In Excel Tool
To make this tool accessible to everyone, it is offered on a “Pay What You’re Able” basis with no minimum (enter $0 if you’d like) or maximum (your support helps keep the content coming – typical real estate tools sell for $25- $100+ per license). Just enter a price together with an email address to send the download link to, and then click ‘Continue’. If you have any questions about our “Pay What You’re Able” program or why we offer our models on this basis, please reach out to either Mike or Spencer.
We regularly update the tool (see version notes). Paid contributors to the tool receive a new download link via email each time the tool is updated.
- Initial release