Microsoft Office Tutorials and References

In Depth Information

**USE GET.CELL TO HIGHLIGHT NON-FORMULA CELLS**

Figure 17.
You can convert
OR
functions to addition and test whether the result is

TRUE
.

Summary:
Understanding the Boolean logic facts can simplify your
IF

calculations. Remember that
FALSE
is
0
,
AND
is
*
,
OR
is
+
, and everything

else is
TRUE
.

USE
GET.CELL
TO HIGHLIGHT

NON-FORMULA CELLS

Challenge:
You want to highlight all the cells on a worksheet that do not contain

formulas.

Solution:
Before VBA, macros were written in an old macro language now

known as XLM. That language offered a
GET.CELL
function, which provides

far more information than the current
CELL
function. In fact,
GET.CELL
can tell

you more than ﬁ ve dozen different attributes of a cell.

GET.CELL
is cool, but there is one gotcha. You cannot enter this function

directly in a cell. You have to deﬁ ne a name to hold the function and then

refer to the name in the cell. For example, to ﬁ nd out whether cell A1 contains

a formula, you use
=GET.CELL(48,Sheet1!A1)
. However, you need

something more generic than this for the conditional formatting formula. Using

=INDIRECT("RC",False)
is a handy way to refer to the cell in which the

formula exists. Thus, the formula to tell if the current cell contains a formula

is:

=GET.CELL(48,INDIRECT("RC",False))