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