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

run vba code new

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Run VBA code when new workbook is created

Run VBA code when new workbook is created

ResolvedVersion 365

Liam has attended:
Excel VBA Intermediate course
Excel VBA Intermediate course
Excel VBA Intermediate course

Run VBA code when new workbook is created

Is there anyway to run VBA code (a subroutine) when a new workbook is created?

RE: Run VBA code when new workbook is created

Hi Liam,

Thank you for the forum question.

Do you mean that you want Excel to execute a macro triggered by a new workbook event?

Do you want Excel to automatically execute a macro every time you create a new workbook.

You can execute your macros in all your files also in a new created file. If the macro is stored in another file, you just have to have the file open to execute the macro in the new created file.

You can also store the macro in your Excel personal template. Then the code can be executed in all files without having at specific file open.

If you want to automatically execute the macro, you will need to define an workbook event to trigger the macro.

Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
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

 

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:

New Normal Worksheet

Do you want all your worksheets to confirm to a certain look? Then change the Defaults!!!
1. Press Shift+F11 to create a new worksheet
2. Press Ctrl+A to select (higlight) all cells, Press Ctrl+1, make any formatting changes then click OK.
3. Press F12 (Function 12 key) click in the Save As Type, drop down, then select Template (*.xlt)
4. Click in the Save in drop-down, then find the folder; c:_program files_microsoft office_office_start. (For the underscores shown use backslash)
Name your templete sheet.xlt, then press Enter.
Sheet.xlt is used when you insert a new worksheet (Shift+F11)

Note: These changes are permanent changes on your PC.

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.09 secs.