Can a VBA module be made to be separate instances
I have spent quite a bit of time work ing on a project under the
assumstion that each sheet in an excell book would use an instance of the
module I was writing. I have multiple sheets that are all the same
template but the sheets are specific to the type of data being stored. In
the module I have setters and getters however, I was expecting the getters
on a given sheet to only access the varibles set by the setters on that
same sheet (an instance of the module). As it turns out all of the sheets
are using the same instance of the module and the setters are over-riding
each other, so that only one sheet has acurate results calculated by the
module. I don't want to get into TMI but the setters provide data that is
used to format the raw data provided by the getters. Is there a way to
make each sheet have an instance of the module with out having to code
each and every sheet. What I mean by that is, when the operator has new
set of relults to be stored and processed they just copy the sheet in
excell and put the data on that new sheet. I don't want the operator to
need to modify the code. I have tried to explain this but I am not sure I
did a good job explaining it properly. Is there a way to make separate
instances of the module?
No comments:
Post a Comment