Declaration of Variables, procedure arguments and Constants

An introduction to the use of variable can be found here: Declaring Variables. Below it is shown how you can save time by using Code VB to declare variables and constants.

Declaring Variables using Code VB

Adding variable using Code VB makes coding faster - click this start demo showing insertion of variable to see it in action.code vb declare variable demo

As demonstrated, you can use declare variable for

The prefix inserted at the location where you will name the variable follows the VB naming conventions which is considered good practice. A benefit of following the prefix conventions is that it allows you to use variables without having to type the complete name by using the VDE intellisense feature. To get intellisense popup, type the prefix and next Ctl-[space]. Click this Start demo screencast to see how intellisense displays variables in your code that have the prefix you typed.Name file string selection demo

Declaring Constants using Code VB

I a similar way constants may be added. Constants are often used for filepaths and object names, so a logical next step is to insert the constant value using the Name insertion feature