March 8, 2025·7 min read

How to Find Any VBA Code in Excel (Without Clicking Through Every Module)

Stop hunting through modules manually. Learn faster ways to navigate VBA projects and find the code you need.

VBA code navigation

You know the feeling. You're in the VBA editor, you need to find a specific procedure, and you press Ctrl+F. The Find dialog opens. You search. It finds nothing.

Then you remember: Find only searches the current module. Not the whole project. Not even all the modules you have open. Just the one you're looking at right now.

So you start clicking. Module1. Module2. Sheet1. Sheet2. ThisWorkbook. That UserForm you forgot existed. Click, search, nothing. Click, search, nothing. Repeat until you find it or give up.

There has to be a better way. And there is — several, actually.

Why VBA Search Is So Painful

The VBA Editor was designed in the 1990s and hasn't fundamentally changed since. Back then, VBA projects were small. A few modules, a handful of procedures. Clicking through them wasn't a big deal.

Modern Excel workbooks are different. A well-structured VBA project might have:

  • 5-10 standard modules organized by function
  • Class modules for custom objects
  • Code behind every worksheet (even if most are empty)
  • ThisWorkbook event handlers
  • UserForms with their own code

That's potentially 20-30 locations to search. And the default Find dialog makes you do it one at a time.

The Hidden “Search All” Option

Here's something many Excel users don't know: the VBA Find dialog can search across all modules. You just have to tell it to.

Open Find (Ctrl+F), then look for the “Current Project” option in the Search dropdown. Change it from “Current Module” to “Current Project” and suddenly your search covers everything.

Better yet, use Ctrl+Shift+F to open Find with project-wide search already selected.

This is a significant improvement, but it has limitations. You still have to click “Find Next” repeatedly to cycle through results. There's no results list. You can't see all matches at once.

Using the Object Browser

Press F2 in the VBA Editor to open the Object Browser. This tool is designed for exploring object libraries, but it also indexes your project's procedures.

In the Project/Library dropdown, select your project name (usually “VBAProject” unless you renamed it). Now you can see all your modules and their public procedures listed in one place.

The search box at the top searches across the selected library. Type a procedure name, press Enter, and see all matches. Double-click any result to jump directly to that code.

The downside: it only shows procedure names, not the code inside them. If you're searching for where a variable is used or where a particular string appears, the Object Browser won't help.

Organizing Code So You Can Find It

The best solution to finding code is never losing it in the first place. Good organization makes navigation trivial.

Use descriptive module names. “Module1” tells you nothing. “mod_DataImport” or “mod_Reporting” tells you exactly what's inside.

One module per purpose. Don't dump everything into one massive module. Separate data handling from UI code from utility functions.

Consistent procedure naming. If all your export procedures start with “Export_” and all your import procedures start with “Import_”, finding related code becomes trivial.

Use the Declarations section. At the top of each module, add a comment block listing what the module contains. When you're hunting for code, you can scan these headers quickly.

The Project Explorer Shortcut

The Project Explorer (Ctrl+R) shows your entire VBA project structure. Most people use it to double-click modules and open them. But it also responds to keyboard navigation.

Click anywhere in the Project Explorer and start typing. If you have a module named “mod_Utilities”, typing “mod_U” will select it. Press Enter to open it.

This is faster than scrolling through a long project tree, but you need to know (or guess) the module name.

Find Everything in Your Workbook with Object Explorer

Named ranges, charts, comments, hidden sheets — Object Explorer shows you everything in your workbook at a glance.

Try Object Explorer Free

Related Reading

Official Resources

📧

Want more Excel tips like this?

Get our free guide: 10 Excel Shortcuts Microsoft Doesn't Tell You About
Join 3,000+ Excel users boosting their productivity.

By subscribing, you agree to receive the free guide and occasional emails with Excel tips and product updates. Unsubscribe anytime. We respect your privacy.