User Forms

UserForms are essentially user-defined dialog boxes. You can use them to display information and to allow the user to input new data or modify the displayed data. The MsgBox and InputBox functions provide simple tools to display messages and get input data, respectively, but UserForms take you to a new dimension. With these, you can implement nearly all the features that you are accustomed to seeing in normal Windows dialog boxes.

You create a UserForm in the VBE window using Insert O UserForm. You add controls from the Toolbox in the same way that you add controls to a worksheet. If the Toolbox is not visible, use View O Toolbox.

UserForms can contain Labels, TextBoxes, ListBoxes, ComboBoxes, CommandButtons, and many other ActiveX controls. You have complete control over the placement of controls and can use as many controls as you need. Naturally, each control can respond to a wide variety of events.

0 0

Post a comment