Example The Option Buttons Click Events

Private Sub optCopy Click()

' Set correct check box label and enable chkOption.Caption = "Copy Formatting" chkOption.Accelerator = "F" chkOption.Enabled = True End Sub

Private Sub optLink Click()

' Set correct check box label and enable chkOption.Caption = "Link Number Format" chkOption.Accelerator = "N" chkOption.Enabled = True End Sub

As usual, the command buttons' Click events are short. They are shown in Example 21-14. Example 21-14. The cmdCancel and cmdSetLabels Click Events

Private Sub cmdCancel Click()

Unload Me End Sub

Private Sub cmdSetLabels Click()

DoDataLabels End Sub

The main portion of the code, the DoDataLabels procedure shown in Example 21-15 (and housed in the UserForm module), checks to see if a data series and label range have been selected and compares their sizes, which must match or else an error message is displayed.

0 0

Post a comment