21 UserForms

21.1 Using UserForms

An input box is a simple way to gather information from the user. But if there is a lot of information it may not be sufficient. Fortunately, VBA lets us create our own dialogue boxes where input boxes are not enough. Such a dialogue box is called a UserForm.

UserForms can be used for both displaying and gathering information. They can contain components such as labels, pictures, text boxes, command buttons and list boxes. We can actually build almost the entire user interface with the help of UserForms.

To create a UserForm select UserForm from the Insert menu in VBE. This will open a new window with an empty dialogue box and a small toolbox window with components that can be dragged onto the dialogue box surface ...

Get Financial Modelling and Asset Valuation with Excel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.