Excel does not have a built-in function that identifies formulas. Once a formula is entered into a cell, you can tell whether the cell is a static value or a value derived from a formula only by clicking in each cell and looking in the Formula bar. This hack fills that gap with a custom function.
The VBA code in this custom function (also called a user-defined function) enables you to identify cells that contain formulas without having to click through 10,000 cells and examine each one.
To become a clever formula hunter,
start by selecting Tools
Function IsFormula(Check_Cell As Range) IsFormula = Check_Cell.HasFormula End Function
Close
the window (press Alt/
The formula returns TRUE if the reference cell houses a formula and FALSE if it does not. You can use this Boolean result in conjunction with conditional formatting so that all formulas are highlighted automatically in a format of your choice.
One of the best things about using this method is that your spreadsheet's formula identification capabilities will be dynamic. This means that if you add or remove a formula, your formatting will change accordingly. Here we explain how to do this.
Select a range of cells on your spreadsheetsay, A1:J500and incorporate some extra cells in case more formulas are added at a later stage.
|
With these cells selected, and with A1 the
active cell of the selection, select Format
|
At this point, the specified formula should be applied to all cells on your worksheet that contain formulas. If you delete or overtype a cell containing a formula, the conditional formatting will disappear. Similarly, if you enter a new formula into any cell within the range, it too will be highlighted.
This simple conditional formatting hack can make your spreadsheets a lot easier to deal with when it comes time to maintain or modify them.