JasonEnsor
Programmer
Hi Guys,
I am just looking for some thoughts and opinions about the structure of my VBA code. In my current projects I am slowly starting to move a lot of my Userform code in to procedures in order to allow re-use of code. In theory my userform will just end up being a events with calls to my procedures. I was just curious as to whether it is worth storing each procedure in it's own module file. Also is it a good idea to have specific error handlers for all my procedures or can I produce a generic error handler that then calls a case statement in a module. This is my attempt at trying to reduce repetition of code and enabling me to make updates only in one place.
One practice I am starting to use is creating a module for global variables, a module for Consts, A general Utilities module that I am populating with reusable code bit by bit and module for general comments regarding the application.
What do you guys do when starting a new project?
Just trying to get ideas to help improve my structure and approach really as I am not bound by any company standards etc... I am trying to get myself in to a proper consistent structure.
Regards
J.
I am just looking for some thoughts and opinions about the structure of my VBA code. In my current projects I am slowly starting to move a lot of my Userform code in to procedures in order to allow re-use of code. In theory my userform will just end up being a events with calls to my procedures. I was just curious as to whether it is worth storing each procedure in it's own module file. Also is it a good idea to have specific error handlers for all my procedures or can I produce a generic error handler that then calls a case statement in a module. This is my attempt at trying to reduce repetition of code and enabling me to make updates only in one place.
One practice I am starting to use is creating a module for global variables, a module for Consts, A general Utilities module that I am populating with reusable code bit by bit and module for general comments regarding the application.
What do you guys do when starting a new project?
Just trying to get ideas to help improve my structure and approach really as I am not bound by any company standards etc... I am trying to get myself in to a proper consistent structure.
Regards
J.