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

initialise

ResolvedVersion 2007

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

Initialise

Hello,
I am having problem intialising a UserForm on when document opens. And also I cannot make the command button work. I am trying to do a form and I want the form to open when initialise and to fill in the form then it actully fills in the actual word/excel form. I have inserted bookmarks but when I press cmd OK nothing happens.

Regards
Hindu




RE: Initialise

Hi Hindu

Thanks for getting in touch. For the first part, you have to insert a macro at the Workbook level. This wouldn't have been covered on a standard VBA intro / intermediate course.

In the VBE, above where the Forms are stored in Project Explorer, there is an object called "ThisWorkbook". Double-click this and add code like this:

Private Sub Workbook_Open()

UserForm1.Show

End Sub

...where UserForm1 is the name of your form. This will bring up the form on first load.

For the second part, what code have you put behind the OK button? It may be useful to paste that code in your reply.

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

Tue 26 Feb 2013: Automatically marked as resolved.

 

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:

Activating the formula bar with the keyboard in Excel 2010

The formula bar in Excel 2010 contains a number of different formulas. However, it is time consuming to open the formula bar every time and insert the formula using the mouse. Instead, you can activate the formula bar with the keyboard. Simply press the F2 button on the keyboard then the information in the cell will expand allowing you to edit the information in the cell.

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.