VBE_Extras adds a whole load of functionality (see What is VBE_Extras) to the standard VBE. But sometimes, rather than the major areas of functionality, it's just the little things that it does that make me smile. Here's an example.
As you're typing out VBA code, you often need to type a pair of symbols e.g. a pair of parenthesis, a pair of speech marks etc. VBE_Extras will help you with this ... as you type (or delete) one member of a pair, VBE_Extras will add (or delete) the partner of that pair. Pairs are:
Parentheses: ( )
Speech marks: " "
Square brackets: [ ]
Braces: { }
Hash symbol (number sign): # #
Here's a demo ...

Note that the pair will only be auto closed if typing at the end of a physical line or, when typing within a line (i.e. there are one or more characters to the right of the insertion point), if the character immediately to the right of the insertion point is a space character or is itself the closing half of a pair. Auto closing pairs does not work in code comments.
Select which pairs will be auto closed in the 'AutoText' tab of the VBE_Extras Settings dialog (all auto closing pairs are switched off by default ... you need to switch this functionality on to use it).
A double-press of the Shift key before typing a member of a pair will temporarily (for 5 seconds) suspend the adding or deleting of the partner of the pair. Holding down the Shift key while pressing the Backspace key will prevent the partner of a pair from being deleted.
See the VBE_Extras user guide for more details on auto closing pairs (particularly on use of #) and for help with all other VBE_Extras functionality.
Auto closing pairs ... saves one whole keystroke per pair. I can't start to imagine how many keystrokes that would save over a year of writing VBA code! Makes me smile ...
コメント