Creating a UserForm “Menu”
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: by using command buttons and by using a list box.
Using CommandButtons in a UserForm
Figure 14.1 shows an example of a UserForm that uses
command buttons as a simple menu.
Setting up this sort of UserForm is easy, and the code behind the UserForm is straightforward. Each command button has its own procedure for its
Click event. For example, the following procedure is executed when
CommandButton1 is clicked:
Private Sub CommandButton1_Click()
This procedure hides the UserForm, runs ...