In This Chapter
Sometimes, you might want to use a UserForm as a type of menu. In other words, the UserForm presents some options, and the user makes a choice. This section presents two ways to do this: using CommandButtons or using a ListBox.
Figure 14.1 shows an example of a UserForm that uses CommandButton controls as a simple menu.
Setting up this sort of UserForm is easy, and the code behind the UserForm is straightforward. Each CommandButton has its own event-handler procedure. For example, the following procedure is executed when CommandButton1 is clicked:
Private Sub CommandButton1_Click() Me.Hide Macro1 Unload Me End Sub
This procedure hides the UserForm, calls Macro1, and then closes ...