Form Box

artexcel

New Member
Joined
Jul 29, 2010
Messages
5
I created a form box in Excel 2007 using an online code. What I would like to do is open my workbook and have the form appear via a macro. I can only open the form by opening the VBA window then click on the Run Sub/ User Form arrow. When I click that icon my workbook opens with the form and I can then enter data. Could you please advise how to make the form appear on my worksheet without having to open the VBA window? I thank you in advance for your help!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
If you want the form to appear when you open the file, in the VB Editor, Project window, double click ThisWorkbook and paste in

Code:
Private Sub Workbook_Open()
userform1.Show
End Sub
 

artexcel

New Member
Joined
Jul 29, 2010
Messages
5
Thank you for your expeditious reply! That works great when I'm in the VBA editor but what I really want (I think) is a macro button I can click on when I open the workbook. When I click that button, I would like for the form to populate so I can start entering data. Currently I open the workbook, then I open the VBA editor and I click the Run Sub/Form F5 button and it opens the form on my worksheet. Thanks again in advance!
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Add a button from the Controls Toolbar, right click it, select View Code and paste in

Code:
Private Sub CommandButton1_Click()
userform1.Show
End Sub
Press ALT + Q to exit the code window, on the Controls toolbar click Exit design mode (the top left icon) then click the button.
 

artexcel

New Member
Joined
Jul 29, 2010
Messages
5
Thank you again for your help! I am continuing to work on this again today and hopefully I will get it. Cheers!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,732
Messages
5,833,380
Members
430,206
Latest member
Sami Gaid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top