Adding a Form to Your Project
A form is a separate object that you can add to your VBA project. When you insert the a user form VBA will perform the following tasks:
· It displays the Toolbox
· It creates a new UserForm object and adds it to the forms branch
· IT adds a Forms branch to the project tree in the Project Explorer
· It displays the form in the work area with a default name such as UserForm1
When you create a new Form it is basically an empty shell until you populate it with controls then it becomes useful. The Toolbox has a set of 14 default controls which you can insert. Including command buttons, which let the user accept the form data, cancel the form or carry out another command with a click if the mouse. Labels which let you adds text to the form, text boxes which let the user enter text and numbers into the form and Check boxes which let the user select options that can be toggled on and off.
Form and Control object Properties
The control objects that you add to a form and the form have an extensive list of properties that you can manipulate by entering or selecting values in the properties window. Some examples of form-level properties include font which will set the default font for the form. CenterScreen will position the form in the centre of the screen and BackColor will change the background colour of the form.
You could attend a Excel VBA course which will teach this and more in a lot more detail.