Winning with Worksheets

Generally, THE Worksheet OBJECT is your gateway to doing anything useful in Excel. Other than the Range object, it's probably the most common object that you'll use. Unlike the Range object, it's not very difficult to master because it doesn't have nearly as many properties and methods.

Usually, your application will need to make some sort of assumptions about either worksheet names, the order of worksheets in the workbook, or some other identifying feature. Because worksheets can be added, deleted, and renamed, it's important that you program defensively when you're accessing a worksheet to avoid run-time errors. This chapter presents some procedures you can use to avoid the potential pitfalls associated with making assumptions regarding worksheet names.

Whatever you do, don't skip the section of the chapter dealing with worksheet events. Though the Worksheet object is sparse in terms of the number of events it has, it has two events that you can use to implement a wide range of "intelligent" functionality.

0 0

Post a comment