vba user forms automaically
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Tue 7 Jun 2011, 12:10Delegate Jim said...

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

For upcoming training course dates see: Pricing & availability

replyReply Wed 8 Jun 2011, 10:42Trainer Stephen said...

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

 

Please browse our web site to find out more about
advanced excel ms training and other Microsoft training courses.

Excel tip:

Formst Excel to display leading zeroes

Select the cells that you want to have displaying leading zeroes.

From the 'Format' menu select 'Cells' (Or Right-click on the selected range and and select 'Format Cells').

In the 'Number' tab click on 'Custom' in the 'Category' window.

In the 'Type:' box enter zeroes that correspond to the size of the required number (eg 5 zeroes).

Click OK.

When you enter numbers into these cells, leading zeroes will be displayed.

eg 123 = 00123

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard