VBA Property Sheet
The code window shown in Figure 1-7 will look very familiar to those with VB 6.0
experience.
Figure 1-7. The VBA code window
CHAPTER 1 n THE MACRO RECORDER AND CODE MODULES 7
At the top of the code window are two drop-down lists. On the left is the Object box,
where any objects associated with the current selection are listed. On the right is the
Procedure/Events box, where all methods and events for the currently selected object are
displayed.
With Sheet1 selected in the Project Explorer, choose Worksheet from the Object box in
the code pane. The default method for the worksheet object, Worksheet_SelectionChange, is
inserted into the code window. Open the Procedure/Events box to see other methods and
events available to you, as shown in Figure 1-8.
Figure 1-8. The code pane with the procedure list open
In the bottom-left corner of the code pane are two command buttons that determine how
your procedures are displayed: Full Module View and Procedure View (shown in Figure 1-9).
CHAPTER 1 n THE MACRO RECORDER AND CODE MODULES 8
Figure 1-9. Full Module view
By default, Excel shows all procedures in a module (Full Module View). Clicking the Procedure
View button (Figure 1-10) filters out all code except the procedure in which the cursor
is located.
Figure 1-10. Procedure view
Immediately above the vertical scroll bar is the split bar, shown in Figure 1-11. Dragging
this bar down splits the code window into two horizontal panes. Each pane can be scrolled
separately, allowing viewing of two sections of a module at once.
Pages:
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36