Multiple Modules, or one big one?

  • Thread starter Thread starter Adrian
  • Start date Start date
A

Adrian

Some of you will know that I am gradually rewriting a huge
suite of .XLM macrosheets in VBA, and I'm learning as I go.
The work done so far is now a large enough project for me
to think about spreading it into several modules, instead
of keeping it all in one.
The advantages are obvious - but are there any
disadvantages, however trivial?

By the way, many many thanks to those that have helped me
already - you know who you are!
 
Any disadvantages are negligible. IMO it is the right approach, indeed a
necessary approach if you want to be able to maintain your code in the
future.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Adrian,

There are no disadvantages, and many advantages, to using several
modules rather than one large module. Distribute procedures
among modules based on their function, e.g., UDFs in one module,
utility code in another, menu/command bar code in another, etc.
Give each module a meaningful name rather than sticking with the
default Module1, Module2, etc.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top