Obtaining Help Has Never Been So Easy

You've now seen that you can use a simple keystroke to obtain detailed help and documentation about an item directly from the Object Browser. As you develop your application, you can highlight any keyword, statement, or object, and also obtain help just by pressing F1. The VBA help files are quite detailed and contain lots of examples. That said, I won't spend any time here detailing how to use the help system other than to point out a few things. Figure 2.16 shows the help page for the Worksheet object.

OBTAINING HELP HAS NEVER BEEN SO EASY 27

Figure 2.16

You'll appreciate the quality documentation and help files that are a keystroke away.

Figure 2.16

You'll appreciate the quality documentation and help files that are a keystroke away.

© Microsoft Visual Basic Help

[email protected]®

worksheet object

See Also Properties Methods Events

■Multiple objects ;

Worksheet |

^—[Multiple objects ]

Represents a worksheet. The Worksheet obiact is a member of the Worksheets colection. The Worksheets collection contains all the Worksheet cbfrects In a worWjock,

Using the Worksheet Object

The folorang properties for returning a Worksheet object are described in this section;

• Worksheets property

• ActhreSlieet property

Worksheets Property

Use Worksheets(irafe^, where indexes the worksheet index number or name, to return a shgle Worksheet object. The following example hides worteheet one In the active workbook.

Worksheets(1) .ViaHole - False

The worksheet index number denotes the position of the worksheet on the workbook's tab bar. Worksheets (1J is the first (leftmost) worksheet in the workbook, and Worksheets

(Worksheets. Count J is the last cue. All worksheets are included in the index count, even if they're hidden,

<

J§i

VI

Many objects show some sort of hierarchy similar to what you see in Figure 2.16. Though it might not immediately be apparent, the rectangles that say "Multiple objects" are clickable. When you click one, you can either quickly view ancestors or descendents of the object as demonstrated in Figure 2.17.

WARNING The VBA help files are not installed by default when you install Excell. You may need to locate your installation disks the first time you try to display help for VBA-related information.

Finally, as you are learning the Excel object model, something I'll spend most of the book covering, the help page shown in Figure 2.18 may be of use to you. You can find it immediately below the Microsoft Excel Visual Basic Reference item on the Contents tab.

By clicking the small triangle to the right of some of the objects, you'll be taken to a detailed object model associated with the given object.

Finally, many times you can strike it rich when you're looking for help by using the Ask a Question feature. You may have noticed this little feature in Microsoft Office applications. It hangs out in the upper-right corner of the window. If you haven't used it before it probably reads "Type a question for help." You don't need to type a question; a simple phrase that captures the essence of what you want to do does the trick. For example, type loop through a range. In this case, a help topic discusses this very procedure. Some other phrase examples are "hide worksheet," "save a workbook," "print a chart," and "if then else." Many times this feature gets you pointed in the right direction.

Figure 2.17

Click the objects in the Help files to see their ancestors or descendents.

Figure 2.17

Click the objects in the Help files to see their ancestors or descendents.

Excel Vba Object Model

Figure 2.18

The Excel Object Model Help Page not only provides a visual representation of the Excel object model, but it also provides a click-through to the documentation associated with each object.

Figure 2.18

The Excel Object Model Help Page not only provides a visual representation of the Excel object model, but it also provides a click-through to the documentation associated with each object.

0 0

Post a comment