Databases Reference
In-Depth Information
FIGURE 4.20 One condition overriding another.
2 (turning the font red) is ignored. Notice, however, that if the first conditional formatting statement
is made false by setting cell A2 to anything but 12, conditional formatting rule 2 will be implemented
and the font will turn red in cell A2. (After changing the value in cell A2, it may be necessary to
hit F9 to update the Worksheet values depending upon the user's settings.) This is illustrated in
Figure 4.21.
4.8
USING THE MACRO RECORDER TO CAPTURE A PROCESS
Although many of the properties and methods available for use in Excel VBA are documented,
there are many processes that are not. Ironically, the more complicated (and thus useful) a process
is, the less likely it is that it is documented. Fortunately, there is a mechanism built into Excel VBA
that allows users to record actions taken in Excel as macros. The beauty of this utility is that it not
only allows the user to repeat the actions recorded upon demand, but also allows the user to look
at the underlying VBA code that causes those actions to occur. For extremely technical and
complicated processes, this functionality is extremely useful in that it allows the user to record and
capture segments of VBA code that will accomplish a desired task. To demonstrate how this process
is accomplished, the macro recorder will be utilized to record macros that perform linear regression
on a data set. It will then be shown how to modify the code generated by the macro recorder to
create generic subroutines that can be used over and over again.
FIGURE 4.21 Conditional formatting using 2nd statement rules.
Search WWH ::




Custom Search