Wherre best to place code

  • Thread starter Thread starter luke
  • Start date Start date
L

luke

I have an excel workbook that uses active -x controls. It allows the
user to model the performance of a micro-scale wind turbine (small
device that fits onto a rooftop). I have VBA code that is located for
each worksheet, some that is contained in Forms and other code that is
located in modules.

My question is: in terms of keeping the workbook small and running
quickly is it Ok to have code for each worksheet or place it in
modules?


thanks, luke
 
It is best to think of it from a perspective of the workbook design as to
where you should put it. Some code has to go in the worksheet or userform,
event procedures associated with those objects, but where you put any code
that might be called from those procedures is a design issue. It probably
will not make much difference in terms of size and efficiency.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
cheers, it was the size and efficiency I was concerned about. What code
i have appears quite neat and easy to understand.

Luke
 
Back
Top