Running the User Form via a Macro

We will create a macro to display the User Form by pressing a button.

Enter the following in a module using the Visual Basic Editor.


Sub runform()
	UserForm1.Show
End Sub

Return to the spreadsheet and add a button from the Forms Toolbar.

Use the right mouse button to Assign the runform() macro you created to the button.

Change its label to something suitable.
(hold the CTRL key down and click the button to select it.)

Click elsewhere on your spreadsheet then click the button to execute the User Form.

Your Dialog box should appear as follows

formbutt