Automate the Userform option

  • Thread starter Thread starter Petra
  • Start date Start date
P

Petra

I have developed a userform, and I want the UserForm run
autmatically when the excel workbook is opened. What code
do I use to make work for me.

I would appreciate much any help on matte.
Petra W.
 
Go to the Visual Basic Editor (Alt+F11).
In the Project Explorer Pane, double-click on the "This Workbook" item.
This will open the code window for the workbook and will create a sub
like this:

Private Sub Workbook_Open()

End Sub

Between these two lines, add
UserForm1.Show (using whatever the name of your form is)

So it ends up looking like this:

Private Sub Workbook_Open()
UserForm1.Show
End Sub
 
Place the following code on the workbook project section
in vb

Private Sub_worknook.open()
** your sub**

end sub

andres
 
Back
Top