Page 225 - Excel Data Analysis
P. 225

11 537547 Ch10.qxd  3/4/03  12:03 PM  Page 211






                                                                                           FORM CONTROLS 10






                                         You capture control events to determine  Not all events are available for each
                                         when to execute specific code. The   control. In the code window, check the
                                         following list identifies the most   Procedure list box to see the events
                                         common events that occur with the    associated with the selected control.
                                         various controls placed on UserForms.

                                          CONTROL EVENT       OCCURRENCE
                                          BeforeDragOver      User is dragging-and-dropping data onto a control.
                                          BeforeUpdate        Before data in a control is changed.
                                          Change              When the Value property of the control changes.
                                          Click               When the user clicks the control with the mouse button.
                                          DblClick            When the user double-clicks the control.
                                          Enter               Before a control receives focus from the user pressing Enter.
                                          KeyDown             When the user presses a key.
                                          MouseDown           When the user presses the mouse button.

















                                                                                             Mar













                     £ Type UserForm.Show,    ¢ Type additional VBA code   ∞ Switch to Excel and run   ■ The dialog box displays
                     replacing UserForm with    to process the user selection   the macro.        the list of values specified by
                     the name of the UserForm.  value returned by the global                      the subroutine.
                                              variable.                 Note: See Chapter 9 to run a macro.




                                                                                                                     211
   220   221   222   223   224   225   226   227   228   229   230