Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba user forms automaically

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA User Forms automaically showing in a spreadsheet

VBA User Forms automaically showing in a spreadsheet

ResolvedVersion 2003

Jim has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA Advanced course

VBA User Forms automaically showing in a spreadsheet

How do I get a User Form to automatically appear when the spreadsheet opens? I currently have to open the Visual Basic Editor and run from there.

I want to eliminate this step for the end users.

Many Thanks in Advance

RE: VBA User Forms automaically showing in a spreadsheet

Hi Jim

Thanks for your question

You need to use the workbook's open event to do this. Simply go to your vbe's project explorer and double click on the workbook event.
Above the code window click on the object list (currently it will say "general"), and select "Workbook".In the procedure list to the right of this, select "open".
This will create an open procedure. Any code written in there runs whenever the workbook opens. To open a form called MyForm simply write

MyForm.Show


In this procedure to open the form automatically when the workbook opens

Regards

Stephen

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Adding Rows or Columns in an Excel 2010 Worksheet

If you want to add a row to an Excel spreadsheet, these are the simple steps you should take:

With your mouse, right click on the row header below where you want the new row to be added. Then, click Insert.

Follow exactly the same steps if you want to add a column to an Excel worksheet, right click on the column header, choose Insert and the new column will be inserted to the left of the selected column.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.