Reddick VBA Naming Conventions
Reddick VBA Naming Conventions
When creating variable names, it’s important for you to make the type and intended use of each variable
clear and self-documenting. Here are a few rules to follow:
Remember to always make variable names mixed case, with each word or abbreviation in the
variable name capitalized.
Don’t use underscore characters in your variable names.
Abbreviate variable names only when it’s necessary
Make the beginning of each variable name describe the type of data it contains.
Following these conventions will go a long way toward keeping your code concise and readable. The
format for an object is
A prefix appears in lowercase and is used to indicate additional information, such as the scope of a
variable. The tag also appears in lowercase. It is a short set of characters that indicates the type of an
object The BaseName is used to indicate what the object represents. The first letter of each word in the
BaseName is capitalized. Suffixes, when used, provide additional information about the meaning of the
BaseName. An example of a name for an object is
mstrFirstName
The Prefix m is used to indicate that the variable appears at the module level. The tag str is used to
indicate that the variable contains a string. The BaseName FirstName indicates that the variable holds a
first name.
In addition to the standard notations for variables, there are variable notations for scope and lifetime.
These should be placed at the beginning of the variable, before any other prefix.