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!
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

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!
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,509
Messages
5,511,712
Members
408,862
Latest member
sidneybc

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top