May 2019
Intermediate to advanced
784 pages
18h 27m
English
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.
Figure 14.1 shows an example of a UserForm that uses command buttons as a simple menu.
FIGURE 14.1 This dialog box uses command buttons as a 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()Me.HideMacro1Unload MeEnd Sub
This procedure hides the UserForm, runs ...
Read now
Unlock full access