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

vba

ResolvedVersion 2003

Elaine has attended:
Excel VBA Intro Intermediate course

VBA

When creating code in one workbook how do you make it available to other workbooks?

Make Code Available

Hi Elaine

If code is written in the Personal Macro Workbook it can be used by all workbooks that are opened on your computer.

Also, if Procedures(Macros) created in any workbook are preceded by the word Public (eg Public Sub MyMacro() ) then they will be visible by all open workbooks.

The danger of writing code in one workbook (Book A) to be used in another workbook (Book B), is that Book A has to be open on the computer for Book B to be able to use the code.

This means that if Book B is sent to someone else they can't run any of the code.

As a good practice I always advise people to copy the code into all the workbooks that will be using it.

It may be duplication of code but will save hours of frustration in the long term.

Regards

Carlos

 

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:

Generating simple column charts

1.Select cell range containing data/figures
2. Press F11

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.