Arjun
Arjun

Reputation: 380

Linking VBA Module with other Excel Sheets

This is about excel VBA.

Like you can compile any code into object code and link it with as many different executables as you like, can you do the same with VBA code in excel. If not exactly the same, but something similar in concept?

I have essential macro codes in Book A. This book is very complex and has many macros.

I have essential formulas in Book B - these formulas are intricately defined as macros in Book A. Can these formulas be linked without having to create a new module in Book B and copying the code from Book A to Book B?

I want to avoid copying code from Book A to Book B since that would mean I would have to update my code on each copy whenever there is a change. Is this possible?

Upvotes: 0

Views: 570

Answers (1)

Harassed Dad
Harassed Dad

Reputation: 4704

If you store vba code in an Excel addin (a .xlam file format) you can then link to those modules from any other workbook by setting a reference within the vb Editor via Tools,References

Upvotes: 2

Related Questions