© Matti Mattila, CPFA, CISA, CIA

Footer & Header macro: Input Form

Previous item Next item Previous menu
Input Form
- We create a form with which a user can enter values to variables. We select "Insert - UserForm". As this is the first userform in the module it will be automatically named as "UserForm1".
Picture #1: Inserting a Form
UserForm1 (packed in "xl07b2.zip") can be downloaded here. You can import it - after extraction - to Excel's Visual Basic by selecting: "File - Import File... - [UserForm1.frm]".
Picture #2: UserForm1
- Next, we plan how the form should look like, and resize the form according to our plan.
- In Visual Basic's Toolbox there are controls for creating a user interface. We use Label for text to guide; TextBox for text input; ComboBox for selecting page orientation; and CommandButton to end filling in the form and to hide the form.
- In the Properties window we can select properties to controls in the UserForm1. We change value of Caption for "Label1" to "Enter Header and Footer Information", make changes to font appearance.
- Finally, we have a form shown in the picture 3. We double click the CommandButton1 ("Ready") a command "UserForm1.Hide".