Activate SelectedSheet procedure

Next, we create a procedure that will activate the selected sheet. We want this procedure to be called in three situations; namely, when the user:

• Selects a sheet name from the list box and clicks the Activate button (or uses the Alt-A hot key)

• Double-clicks on a sheet name in the list box

• Selects a sheet name from the list box and hits the Enter key

Since this code will be used in three different situations, we can avoid repeating the code by placing it in its own procedure in the General section of a UserForm, as shown in Example 14-1.

0 0

Post a comment