• Link to Facebook
  • Link to Youtube
  • Link to LinkedIn
  • Link to X
  • Link to Tiktok
  • Link to Instagram
  • EN ESPAÑOL
    • Inicio
    • Glosario de Términos
    • Modelos Financieros
    • Tutoriales Cortos
  • A.CRE HELP
    • Support Section
    • Contact Us
  • LOGIN/REGISTER
  • Shopping Cart Shopping Cart
    0Shopping Cart
Adventures in CRE
  • A.CRE
    • A.CRE Home
    • A.CRE Help
    • Accelerator
      • Learn More
      • Login
    • AI.Edge
      • Learn More
      • Login
    • Artificial Intelligence
    • Careers
    • CRE Event Calendar
    • CRE Job Board
    • Education
    • Library of Excel Models
    • Meet the A.CRE Team
  • RE Modeling
    • 1031 Exchange
    • Audio Series
    • All-in-One (Ai1) Model
      • Download
      • Guides and Tutorials
      • Support
    • Ask Me Anything (Live)
    • Beginner’s Guide to Excel
    • Excel Models
      • Excel Add-ins
      • Library of Excel Models
      • All-in-One (Ai1) Model
      • Apartment
      • Condo
      • Debt
      • Development
      • Equity Waterfall
      • Hotel
      • Industrial
      • Office
      • Portfolio
      • Retail
      • Single Family
      • Tutorial
    • Excel Tips
    • Practice Library of Case Studies
    • Stochastic Modeling
    • Argus
    • My Downloads / My Account
  • Careers
    • About Careers in Real Estate
    • Ask Me Anything (Live)
    • Audio Series
    • Compensation in Real Estate
    • CRE Job Board
      • Find a Job
        • Browse Jobs
        • Post a Resume
        • Register
        • Login
      • Post a Job
    • CRE Event Calendar
    • CRE Interviews
    • Day in the Life Series
    • Real Estate Legal Content
    • What CRE Pros Do
  • Education
    • Accelerator
    • AI.Edge
    • A.CRE 101
    • Ask Me Anything (Live)
    • A.CRE Audio Series
    • Audio Series
    • Book Reviews
    • CRE Event Calendar
    • Deep Dive Series
    • Glossary of CRE Terms
    • Real Estate Legal Content
    • Real Estate Clubs
    • University Profiles
    • Watch Me Build
  • AI
    • AI Skills
    • AI Use Cases in CRE
    • AI for CRE Training
    • AI Tools for CRE
    • AI.Edge Membership
      • Learn More
      • Login
  • Accelerator
    • Accelerator Reviews
    • Accelerator Story
    • Enroll Now
    • Learn More
    • See What’s New
    • Enterprise Members Only
      • General Enterprise Login
      • ICSC Login
      • M&M Login
    • Members Only
      • Extend/Renew Membership
      • Login
      • Manage Membership
  • My Downloads
    • View My Downloads
    • Find an Excel Model
    • Register
    • Login
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu
You are here: Home1 / Real Estate Financial Modeling2 / Excel Tips3 / Using VBA to Hide Rows in Excel
Spencer Burton
Real Estate Financial Modeling, Excel Tips, Tutorial

Using VBA to Hide Rows in Excel

Over the next few minutes, I will show you two techniques for automatically hiding and showing rows in Excel using VBA code. These techniques I use regularly in my real estate financial models to make for a more intuitive user experience.

In the past, I’ve created similar tutorials for hiding worksheets or creating dynamic buttons and toggles. And in fact, this logic can be used in tandem with those techniques to really improve the usability of an Excel model.

To teach this concept, I’ve recorded a short 10 minute video, attached a completed file, and included a link to the VBA I use. I’ve also written out the basic steps for you to follow.

Excel VBA

These simple techniques help make complex models easier to navigate and use.

Download the VBA Code and Completed Workbook

To get you started, below find links to download the VBA code and completed file used in the video tutorial.

  • Click here to download the basic VBA code used in this tutorial
  • Click here to download the basic Excel file created in this tutorial

Video Tutorial – Using VBA to Hide Rows in Real Estate Excel Models

The following 10 minute video will walk you through the process of using VBA to hide and show rows in your real estate Excel models. My recommendation is to open an open Excel workbook and follow along as I teach the techniques. Refer to the written instructions below and be sure to have downloaded the VBA code and completed file above to help you.

Technique #1 – Using a Drop-Down Menu to Hide or Show Rows

The first technique in the video involves using drop-down menus to hide or show rows. This is a really simple and intuitive method, but it’s not without its drawbacks.

The downside to this technique is that the code runs each time a change is made to the worksheet where the code is included. This can dramatically slow down a Workbook. Here are the basic steps for using technique #1.

  1. Be sure the file is saved as a ‘Macro-enabled Workbook’
  2. Create a drop-down menu
  3. Right-click on the tab for the worksheet containing the drop-down menu and select ‘View Code’
  4. This will open code specific to the selected worksheet
  5. Enter VBA (download code above) logic that shows or hides defined rows based on the value in the drop-down menu cell

Technique #2 – Using a Buttons to Hide or Show Rows

The second technique in the video involves using buttons to hide or show rows. This is my preferred technique, as the code only runs when a button is pressed. It however takes an additional step or two to build and does not integrate as efficiently into the Worksheet as in-cell drop-down menus do.

  1. Be sure the file is saved as a ‘Macro-enabled Workbook’
  2. Insert two shapes and enter ‘Hide’ in one shape and ‘Show’ in the other
  3. Go to the Developer ribbon and select ‘Visual Basic’ (Don’t see the Developer ribbon?)
  4. A Visual Basic window will appear, go to Insert>Modules
  5. A new module with be created with a blank
  6. Create two Macros (download code above), one to hide a row and the second to show a row
  7. Close the VBA window and right-click on the shape entitled ‘Hide’; select  ‘Assign Macro’ and choose the ‘Hide’ Macro
  8. Right-click on the shape entitled ‘Show’; select  ‘Assign Macro’ and choose the ‘Show’ Macro

Frequently Asked Questions about Using VBA to Hide Rows in Excel

What are the two VBA techniques shown for hiding and showing rows?

The tutorial demonstrates two techniques: (1) using a drop-down menu to control row visibility, and (2) using buttons (shapes with assigned macros) to hide or show rows.

How does the drop-down menu method work?

You create a drop-down menu and write worksheet-specific VBA that responds to the cell value change by hiding or showing defined rows accordingly.

What is a drawback of the drop-down menu technique?

The code runs every time a change is made on the worksheet, which can significantly slow down performance.

Why is the button method preferred by the author?

It only triggers the VBA when a button is pressed, improving performance and minimizing unnecessary processing.

What are the basic steps for setting up the button technique?

Steps include: inserting shapes, writing separate hide/show macros in a new module, and assigning each macro to its respective shape using the ‘Assign Macro’ function.

What type of Excel file must be used for these techniques?

The workbook must be saved as a “Macro-enabled Workbook” (.xlsm).

Can these VBA techniques be combined with other usability features?

Yes. The VBA logic can be integrated with other features like dynamic buttons and toggles to further enhance user experience.

Where can I find the VBA code and example workbook?

Download links for the basic VBA code and the completed Excel workbook are included in the original blog post.

Who created the tutorial and tools?

The tutorial was created by Spencer Burton, Co-Founder and CEO of CRE Agents, with over 20 years of CRE experience and more than $30 billion in underwriting experience.


About the Author: Spencer Burton is Co-Founder and CEO of CRE Agents, an AI-powered platform training digital coworkers for commercial real estate. He has 20+ years of CRE experience and has underwritten over $30 billion in real estate across top institutional firms.

Spencer also co-founded Adventures in CRE, served as President at Stablewood, and holds a BS in International Affairs from Florida State University and a Masters in Real Estate Finance from Cornell University.

Contact Spencer

 

by Spencer Burton
Share this entry
  • Share on X
  • Share on LinkedIn
  • Share by Mail
  • Link to Instagram
  • Link to Youtube
https://www.adventuresincre.com/wp-content/uploads/2020/02/hide-rows-in-excel.jpg 391 640 Spencer Burton https://adventuresincre.com/wp-content/uploads/2022/04/logo-transparent-black-e1649023554691.png Spencer Burton2020-02-01 11:27:202025-08-07 15:15:24Using VBA to Hide Rows in Excel
You might also like
Create Dynamic Sub-Property Type Drop-Down Menus in Excel
Supercharge Excel with the ‘Excel 4 CRE’ Add-In – Now with AI (Updated Jan 2026)
Create A Dynamic Revenue Row to Calculate Multiple Tenant Leases (Updated Nov 2022)
Hide and Unhide Tabs using Drop-down Menus in Excel (Updated Apr 2024)
Microsoft has blocked the macros in my A.CRE model – What now?
Keyboard Shortcuts I Use Constantly When Modeling in Excel (Formatting)
Accelerator - Learn More

Featured Content

  • RE Financial Modeling Training
  • Library of Excel Models
  • Post a Job – It’s Free
  • Master Financial Modeling
  • Technical Interview Guide
  • Definitive Guide to Excel
A.CRE Library of Excel Models

Recent Posts

  • AI Tools for Commercial Real Estate (Summer 2026 Edition)
  • The 2008 Financial Crisis, From the Ground Up: Why We Believed Houses Were Safe
  • Real Estate Equity Waterfall Model – IRR and Equity Multiple Hurdles (Updated June 2026)
  • A.CRE Self Storage Development Model (Updated June 2026)
  • Episode 12 of Multipliers: Ask Why Until the Answer Changes

Note About Models

Models downloaded from A.CRE may contain errors. Verify formulas/methodology before basing investment decisions on any model here. Read our Terms and Conditions of Use and Disclaimer.

★★★★★

Accelerator Reviews

Search Adventures in CRE

Search Search

Have a Question or Need Help?

Visit our Help Section

Contact Adventures in CRE

  • Visit A.CRE Help
  • Via Email
  • Via LinkedIn

You Might Also Like

  • Real Estate Modeling Courses
  • Real Estate Financial Modeling
  • A.CRE Job Board
  • Careers in Commercial Real Estate
  • Real Estate Education

A.CRE Library of Excel Models

  • Browse Excel Models
  • Login/Register
  • View My Downloads
  • Edit Account Details

Terms, Policies, and Disclaimer

  • Privacy Policy
  • Cookie Policy
  • AI Usage Policy
  • Terms of Use
  • Disclaimer
© 2014 - Present - Copyright - www.AdventuresinCRE.com, LLC | Adventures in CRE | A.CRE
  • Link to Facebook
  • Link to Youtube
  • Link to LinkedIn
  • Link to X
  • Link to Tiktok
  • Link to Instagram
Link to: Watch Me Build Data Tables For Real Estate Sensitivity Analysis Link to: Watch Me Build Data Tables For Real Estate Sensitivity Analysis Watch Me Build Data Tables For Real Estate Sensitivity Analysis Link to: A.CRE Audio Series Season Two – Coming March 2020 Link to: A.CRE Audio Series Season Two – Coming March 2020 A.CRE Audio Series Season Two – Coming March 2020
Scroll to top Scroll to top Scroll to top