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

Microsoft Office Excel 2003 Programming Inside Out

                             In Figure 12-3, you can see how to create a new Worksheet event procedure.




























                             Figure 12-3.  This is how to create a new Worksheet event procedure.

                             After you have created the new event procedure, you’ll notice the Private Sub
                             Worksheet_Event and End Sub code has been added to the code window. Table 12-2
                             describes the commonly used Worksheet events.

                             Table 12-2.  Commonly Used Worksheet Events
                             Worksheet Event     Action That Triggers Event
                             Change	             Monitors the Change event for the worksheet. The event is
                                                 triggered when the cells of the worksheet are changed by the user
                                                 or by an external link.
                             Selection Change	   Monitors the SelectionChange event for the worksheet. The
                                                 event is triggered when the user chooses a new selection on
                                                 the worksheet.
                             BeforeRightClick	   Monitors the BeforeRightClick event for the worksheet. The event
                                                 is triggered when the user right-clicks the worksheet.


                             Note  To navigate to the event procedures in a worksheet, you can right-click the sheet
                             tab in the Excel program window and select View Code.



             Chapter 12


                274
             Part 4:  Advanced VBA
   295   296   297   298   299   300   301   302   303   304   305