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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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
 
Upvote 0
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!
 
Upvote 0
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.
 
Upvote 0
Thank you again for your help! I am continuing to work on this again today and hopefully I will get it. Cheers!
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,533
Members
448,969
Latest member
mirek8991

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
Back
Top