The Books Text and Sample Code

When reading this book, you will encounter many small programming examples to illustrate the concepts. I prefer to use small coding examples, hopefully, just a few lines, to illustrate a point.

Personally, I seem to learn much more quickly and easily by tinkering with and tracing through short program segments than by studying a long, detailed example. The difficulty in tinkering with a long program is that changing a few lines can affect other portions of the code, to the point where the program will no longer run. Then you have to waste time trying to figure out why it won't run.

I encourage you to follow along with the code examples by typing them in yourself. (Nevertheless, if you'd rather save yourself the typing, sample programs are available online; see Section P.7 later in this Preface.) Also, I encourage you to experiment — it is definitely the best way to learn. However, to protect yourself, I strongly suggest that you use a throw-away workbook for your experimenting.

One final comment about the sample code is worth making, particularly since this book and its coding examples are intended to teach you how to write VBA programs for Microsoft Excel. Generally speaking, there is somewhat of a horse-before-the-cart problem in trying to write about a complicated object model, since it is almost impossible to give examples of one object and its properties and methods without referring to other objects that may not yet have been discussed. Frankly, I don't see any way to avoid this problem completely, so rather than try to rearrange the material in an unnatural way, it seems better to simply proceed in an orderly fashion. Occasionally, we will need to refer to objects that we have not yet discussed, but this should not cause any serious problems, since most of these forward references are fairly obvious.

0 0

Post a comment