vba

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

Forum home » Delegate support and help forum » Microsoft Excel Training and help » VBA

VBA

resolvedResolved · Low Priority · Version Standard

Edward has attended:
Excel VBA Intro Intermediate course
Access Introduction course
Access Intermediate course
Access Advanced course
Access VBA course

VBA

How do you get a macro to function automatically on opening of a workbook?

RE: VBA

Hi Edward

To run a macro when the workbook opens you need to do the following:

1. In the VB Editor double click "This Workbook" in the project window

2. The code window for "This Workbook" appears

3. In the drop down area at the top select Workbook. The Open Event Procedure appears.

4. Call the macro as shown below:

Private Sub Workbook_Open()

Call MyMacro

End Sub


Hope this helps

Carlos

 

Training courses

 

Training information:

See also:

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:

Autofit column width – Excel (all versions)

a. Highlight the column or columns you wish to alter the width of. You do this by clicking on the grey button at the top of the column showing the column letter. Click and drag on these letters to select more than one column.
b. Double click the dividing line between the columns. This dividing line is the break between the columns on the column headers (grey buttons showing the column letter at the top of each column). When you hover your mouse over one of these dividing lines the point will change and show an arrow pulling a line in two directions. When you have this mouse pointer you should double click to get Excel to automatically set the column width to fit the contents of the column (autofit)

View all Excel hints and tips


Server loaded in 0.08 secs.