Page 45 - Excel Progamming Weekend Crash Course
P. 45
d540629 ch02.qxd 9/2/03 9:27 AM Page 20
20 Friday Evening
To export a module, do the following:
1. Right-click the module in the Project Explorer, and select Export File from the pop-
up menu. The Export File dialog box is displayed (see Figure 2-2).
Figure 2-2 Exporting a module
2. Use the dialog box to select the folder for the exported file to be saved in.
3. Accept the default filename, or enter one of your own. The file extension is speci-
fied by Excel based on the type of element being exported: .CLS for Microsoft Excel
objects and class modules, .BAS for regular modules, and .FRM for user forms.
4. Click Save.
To import a module:
1. Right-click the project name in the Project Explorer, and select Import File from
the pop-up menu. The Import File dialog box is displayed.
2. Select the desired .BAS, .FRM, or .CLS file.
3. Click Open.
Editing Tools
Within an editing window, the Code Editor works like any other text editor in most respects.
With it, you can move the cursor; enter and delete text; copy, cut, and paste; and so on.
There are, however, some special editing features provided by the VBA Code Editor that are
designed specifically to ease the task of writing VBA code. They are:
Auto Syntax Check. When you complete a line of code, the Editor checks its syntax
and notifies you if there is a problem; otherwise, syntax errors are caught only
when the code is executed.
Auto List Member. This feature displays a list of items that could logically com-
plete the code statement you are typing. You can select from the list or continue
typing something else.