Developer

Let VBA identify mistakes when you're entering code

This simple tip for entering VBA code can help you quickly discern mistakes.

My all-time favorite tip for writing VBA code is also one of the simplest: Use lowercase letters when entering code.

When VBA recognizes keywords and other VBA reserved words, it capitalizes the appropriate letters in each component. Failure to capitalize is an immediate visual clue that you've entered something incorrectly. When this happens, check your spelling — a simple typo is the most common problem. If the spelling is correct, you've probably used the keyword inappropriately, so check the syntax.

If you enter code in proper case, this helpful and automatic clue loses its effectiveness.

About Susan Harkins

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

Editor's Picks

Free Newsletters, In your Inbox