How do you display a VBA user form when starting excel workbook?

D

dant

How do you display a VBA user form when starting excel workbook? Code works
to populate a list box based on choice in previous list box but how do you
show the form so that it can be used when you start excel? I want to make it
an excel form to collect data that has interdependanrt fields.
 
M

MBlake

Open your VBE window (Alt+F11)
Ensure your Project Window is open (View - Project Explorer)
Click on the 'This Workbook' for your Excel file

Add code but substitute MyForm for the name of your userform.

' Opens userform at startup
'
Private Sub Workbook_Open()
frmMyForm.Show
End Sub

Regards,
Mickey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top