Microsoft Office Tutorials and References
In Depth Information
What Makes a Good Utility?
The ComboBoxOperation_Change procedure in the UserForm1 code module
This procedure is executed whenever the user selects an item in the ComboBoxOperation . It
does the work of displaying or hiding the other controls. For example, if the user selects the
Change Case option, the code unhides the second ComboBox control (named ComboProc1 ) and
fills it with the following choices:
h UPPER CASE
h lower case
h Proper Case
h Sentence case
h tOGGLE cASE
The ApplyButton_Click procedure in the UserForm1 code module
This procedure is executed when the Apply button is clicked. It does some error checking to
ensure that a range is selected and then calls the CreateWorkRange function to make sure that
empty cells aren’t included in the cells to be processed. See the upcoming section, “Making the
Text Tools utility efficient.”
The ApplyButton_Click procedure also calls the SaveForUndo procedure, which saves the
current data in case the user needs to undo the operation. See “Implementing Undo,” later in this
chapter.
The procedure then uses a Select Case construct to call the appropriate procedure to
perform the operation. It calls one of the following Sub procedures:
h ChangeCase
h AddText
h RemoveText
h RemoveSpaces
h RemoveCharacters
Some of these procedures make calls to function procedures. For example, the ChangeCase
procedure might call the ToggleCase or SentenceCase procedure.
The CloseButton_Click procedure in the UserForm1 code module
This procedure is executed when the Close button is clicked. It saves the current control settings
to the Windows Registry and then unloads the UserForm.
 
Search JabSto ::




Custom Search