View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
atpgroups atpgroups is offline
external usenet poster
 
Posts: 40
Default How best to break up code

On 9 May, 00:18, shelfish wrote:

So my question is, how do I create this "well structured code" when I
have SO MANY declarations which need to be used across the different
procedures?


It may not count as "Well structured code" but if you declare them
outside any procedure (ie outside the sub-end sub) then they become
global to the code module.
If you declare them as, for example, "Public i as Integer" then they
are visible to every routine in your project.

I tend to put all my globals in a separate module. (enumerated types,
for example)

Have a look at class modules, too, that can really tidy things up.