Run Procedure / Immediate Execution — Test VBA Code Without Switching Modules

Run procedure with breakpoint

The Run Procedure feature in Code VBA's Code Explorer lets you execute any procedure directly from the explorer — even if its module isn't currently active. Normally, pressing F5 in the VBA editor runs only the procedure in the active module. With Code VBA, you can right-click a procedure in the explorer and choose Run, allowing you to test code while keeping another module (for example, one with a breakpoint) visible.

This is especially useful when debugging: you can watch the breakpoint trigger in one module while running a different procedure, without constantly switching views.

Immediate Menu Option

Another handy command is Immediate, found in the same context menu. Selecting it automatically:

  1. Copies the procedure name into the Immediate Window, ready for execution or inspection.
  2. Opens the Immediate Window if it's not already visible.

This makes it effortless to test or call procedures interactively — ideal for quick checks or debugging small routines.

In Short

The Run Procedure / Immediate Execution tools turn Code Explorer into a powerful testing interface:

  • Run any procedure without activating its module.
  • Keep your breakpoint module in view while testing.
  • Instantly copy procedure names in the Immediate Window for repeated execution.

Together, they streamline VBA testing and debugging, saving you from repetitive module switching and manual typing.