SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 23 | Next

Jim DeMarco

"Pro Excel 2007 VBA"

These can include worksheets, the workbook itself, standard code modules, class
modules, and any UserForms in the project.
Objects are stored in folders representing their function. In Figure 1-4, you can see the
worksheet objects in the Microsoft Excel Objects folder. Code is placed in its own folder, as are
UserForms.
At the top of the Project Explorer pane is a toolbar that provides access to view code, view
the selected object (choosing this command with Sheet1 selected will bring you to the Excel
window with Sheet1 active), and toggle the folder view on or off. Toggling the folders off lists
all of the objects together in one list regardless of type of object, as in Figure 1-5.
CHAPTER 1 n THE MACRO RECORDER AND CODE MODULES 5
Figure 1-4. Excel objects grouped by object (with Toggle Folders on)
Figure 1-5. Excel objects with Toggle Folders off
The Property Sheet lists properties for the currently selected object in the Project Explorer,
and will look very familiar to those VB 6.0 coders among us. Figure 1-6 shows an example of the
Property Sheet for an Excel worksheet.
Use the code window to write, display, and edit Visual Basic code. You can open as many
code windows as you have modules, so you can easily view the code in different forms or
modules, and copy and paste between them.
You can open a code window from
??? The Project window, by selecting a form or module and choosing the View Code button
??? A UserFormwindow, by double-clicking a control or form, choosing Code from the
View menu, or pressing F7
You can drag selected text to
??? A different location in the current code window
??? Another code window
??? The Immediate and Watch windows
??? The Recycle Bin
CHAPTER 1 n THE MACRO RECORDER AND CODE MODULES 6
Figure 1-6.


Pages:
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35