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

resolvedResolved · Medium Priority · Version 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:

Sorting data stored in rows

Primarily Excel is set up to sort data that is stored in columns rather than rows.

It is possible to get Excel to sort data stored in rows however.

Click in the row you want to sort, or select the cells in the rows you wish to sort.

Go to Data - Sort, then go to the Options button in the bottom left corner of the Sort dialogue box.

View all Excel hints and tips


Server loaded in 0.05 secs.