> ## 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.

# Select Entire Sub or Function in VBA with a Double-Click
- URL: https://nolongerset.com/double-click-select-procedure/
- Published: 2022-11-15T04:46:25.000Z
- Updated: 2026-05-08T12:53:33.000Z
- Description: Yet another hidden feature of the VBA editor that eluded me for more than fifteen years.
- Author: Mike Wolfe
- Tags: Hidden Features, #Import 2026-05-20 02:59

I had been programming in VBA for over 15 years before I learned this trick (yesterday).

> If you double-click in the left margin of a procedure block in VBA, the entire procedure will get selected. 

I knew that a single-click in this area would select an entire line, but somehow I never noticed that double-clicking would select the whole thing. Check out the demo below:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2022/11/Double-click-Select-Procedure.gif)

## Don't Feel Left Out

If, like me, you have been writing code in VBA for years and didn't know this feature existed, don't feel too bad. We're in good company.

I first learned about this when KarlSevenSeven introduced it as a [feature request for twinBASIC](https://github.com/twinbasic/twinbasic/issues/1353). Apparently, *he* had also just learned about it on a forum only a few days earlier. Several of the VBA/VB6 experts over there (including twinBASIC creator himself, Wayne Phillips) were not aware of this feature either:

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

It's amazing how something so simple could have been overlooked by so many developers for so many years. 

It makes you wonder what else might be out there... 🤔

### External References

[Double click to select entire procedure · Issue #1353 · twinbasic/twinbasicIs your feature request related to a problem? Please describe. In VB6 we can double click before a procedure declaration to select the whole procedure. Describe the solution you&#39;d like Same as ...![](https://github.githubassets.com/favicons/favicon.svg)GitHubtwinbasic![](https://opengraph.githubassets.com/6d0e6ef433fdde6d712e5576ea0179dd8c3d78b30018fdc86c03f589cdccd14f/twinbasic/twinbasic/issues/1353)](https://github.com/twinbasic/twinbasic/issues/1353#issue-1446864543)