Yes I know.....google it. I have and I can't seem to find anything that explains when to put code in modules and when it should go in the "thisworkbook" object or in a worksheet object.......
Here's the thing. I am writing my first vba program (well actually first program ever that actually does something useful). The objective is to take investment mean, stdev, and covariance assumptions and generate a number of efficient frontiers using this data. Then it plots a number of different target portfolios and runs Monte Carlo simulations on each target portfolio taking into account cash flows in and out of the portfolio. Then it uses that information to create a number of different worksheets that it populates with data and pretty charts. The idea is that anyone in my company can then put in their own assumptions, run the program, and out pops a perfectly formatted and ready to pdf report. A task that took a couple of days could now conceivably be done in a few minutes.....of course we would still charge the clients as if it took a few days. So far it has surprisingly come together pretty well and most of the pages of the report can now be generated with the click of a button. Here's the thing. When I go into the code it is a complete mess. One sub after the other all on the "ThisWorkBook" Object. I am sure that it isn't supposed to be a jumbled mess. Is their a sticky on this forum that explains how to use modules effectively to get rid of some of the clutter?
Bookmarks