Activating the VBE

When you're working in Excel, you can switch to the VBE by using any of the following techniques:

♦ Choose Tools ^ Macro ^ Visual Basic Editor.

♦ Click the Visual Basic Editor button, which is located on the Visual Basic toolbar.

In addition, you can access two special modules as follows. (These special VBA modules are used for event handler procedures, which I describe in Chapter 19.)

♦ Right-click a sheet tab and then select View Code to access the code module for the active sheet.

♦ Right-click the Excel icon (to the left of Excel's menu bar) and select View Code to access the code module for the ThisWorkbook object of the active workbook.

Don't confuse the Visual Basic Editor with the Microsoft Script Editor. These are two entirely different animals.The Script Editor is used to edit HyperText Markup Language (HTML) scripts written in VBScript or JavaScript.The Script Editor is not covered in this book.

Figure 7-3 shows the VBE. Chances are that your VBE window won't look exactly like the window shown in the figure. This window is highly customizable — you can hide windows, change their sizes, dock them, rearrange them, and so on.

Figure 7-3: The Visual Basic Editor window.
0 0

Post a comment