
Declares variables without moving from the current position. The variable is added at the top of the procedure, in the procedure's interface or in a selected module. A copy can be pasted at the current position using ctrl-v, the place where you actually use it. The builder saves time by:
Start this dialog from Toolbar
or using Alt-CVA (Code-vb - Variable - Add)
The name is kept on the clipboard and can be inserted directly at the position you are working using Ctrl-V.
Alternative: use fast declaration if you only need simple procedure level variables thru menu: Variable > {variable type}
Select if a variable is to be Public or Private or procedure or module level or part of the interface.
If you use prefix (lowercase) the builder will automatically try to interpret type, level and, if it is in the interface, ByRef/ByVal. Prefixing behavior can be changed in the Settings dialog .
Select the type of the variable. While entering characters the type gets selected incrementally. Selecting type may change prefix. Prefixing behavior is defined in the Settings dialog .
Only in case of strings, let's you specify the length of the string
Enter array dimensions the normal way, e.g.
Enter array dimensions the normal way, e.g.
For those professional developers who take documenting code seriously :). The description is added after the declaration, e.g.
or below the procedure interface if it is part of that, e.g.
Set these to define how and where a variable is to be defined as a procedures argument. To indicate it is to be a procedures argument you have to set Accessibility to 'Interface'
ByVal allows the procedure to access a copy of the variable. As a result, the variable's actual value can't be changed by the procedure to which it is passed. As opposed to ByRef in which the variable is shared between the calling and called procedures.
Used only as the last argument in arglist to indicate that the final argument is an Optional array of Variant elements. The ParamArray keyword allows you to provide an arbitrary number of arguments. ParamArray can't be used with ByVal, ByRef , or Optional .
Optional indicates that an argument is not required when calling the procedure.
By checking all options you can have all these statements inserted in one go (example inserting rng as Range variable):
Create an instance of the object.
Efficient way to call a series of properties and methods, e.g.
With rng
.Font.Bold = True
.Select
End With
Explicitly free memory and system resources used by objects.
If you use global variables ( accessibility ) and keep them in an other then the current module. You can select this module here, which saves you a trip to the other module and back.
Creates the variable in the declaration section.
Creates the constant in the declaration section and pastes it at the cursor position.
Closes the builder without creating the variable
Starts this Help topic