> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Find the Yellow Highlighted Line When Debugging in VBA
- URL: https://nolongerset.com/show-next-statement/
- Published: 2022-03-04T04:30:32.000Z
- Updated: 2026-05-08T12:59:19.000Z
- Description: Did you ever lose your place while debugging in VBA? Here's an easy way to find it.
- Author: Mike Wolfe
- Tags: Debugging, #Import 2026-05-20 02:59

One of my favorite features in VBA is the so-called "Edit and Continue."

That's the feature that allows you to set a breakpoint in code, then step through the code one line at a time. The next line of code to be executed is highlighted in yellow. While the program is in break mode, you can wander around the rest of the codebase.

I often wander so far that I forget what line I was troubleshooting in the first place.

When I first started debugging VBA, I would just press F8 to execute the next line of code. That would bring the focus back to wherever I left off. Blindly executing a line of code while debugging is not ideal, though.

Luckily, there is a better way to find that yellow highlighted line of code.

## Show Next Statement

At the bottom of the Debug menu, there is a command named "Show Next Statement."

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/03/image-16.png)

When you click on that command, the VBIDE window will shift focus to the yellow-highlighted line of code, which is the next statement that will be executed when you press \[F8\] to "Step Into."

### Shortcut Key - \[Alt\] + \[D\], \[X\]

As an alternative to the menu, you can use the shortcut **\[Alt\] + \[D\], \[X\]** (Debug > Show Next Statement).

### Customizing the Debug Toolbar

I can never remember the shortcut key, so I like to have the command one click away by adding it to the Debug Toolbar. Here are the steps:

1. View > Toolbars > Customize (*\[Alt\] + \[V\], \[T\], \[C\]*)
2. *\_|* Toolbars |\_ > \[√\] Debug
3. \_| Commands |\_ > Categories: **Debug** \> Commands: **Show Next Statement**
4. Click and drag "Show Next Statement" from the Customize dialog and drop it on the Debug toolbar

You can drop it anywhere you want on the toolbar, but I like to put it between the *Break* and *Reset* icons:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/03/image-17.png)

### Only Available While Debugging

Be aware that if you are not in break mode, the command does not do anything, and so it will appear grayed out on the toolbar.

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/03/image-18.png)

## Show Next Statement in Action

Here's a short video clip showing the feature in action:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/03/714B5DC0-30CB-472F-A73E-A16AB5A4DD1D.GIF)

*Image by [Joshua Woroniecki](https://pixabay.com/users/joshuaworoniecki-12734309/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=5089188) from [Pixabay](https://pixabay.com/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=5089188)*