Page 186 - Microsoft Office Excel 2003 Programming Inside Out
P. 186

Part 3:  The Excel Object Model
                                        Microsoft Office Excel 2003 Programming Inside Out


                             Note  In the case just mentioned, the first worksheet you click would be considered the
                             active worksheet.

                             The following code snippet selects the worksheet named Sheet1:
             Chapter 7
                             Worksheets("Sheet1").Select

                             If you’d like to select more than one worksheet at a time, you can use an array as the argu­
                             ment for the Select method, as in the following example:

                             Worksheets  (Array  ("Sheet1",  "Sheet2")).Select
                             In this chapter, you’ve encountered the most important properties and methods you will use
                             to manipulate Excel workbooks and worksheets. Whether you want to save your workbooks
                             programmatically, change when your formulas are recalculated, or protect your workbooks
                             and worksheets by requiring users to know the password to gain access, you can make your
                             workbooks and worksheets behave as you want them to behave. In Chapter 8, you’ll learn
                             how to perform similar tasks with ranges and cells.










































                160
   181   182   183   184   185   186   187   188   189   190   191