Written by Allen Wyatt (last updated January 23, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and 2021
You probably already know that you can select all the cells containing formulas in a worksheet by pressing F5 and choosing Special | Formulas. If you need to keep a constant eye on where formulas are located, then repeatedly doing the selecting can get tedious. A better solution is to use the conditional formatting capabilities of Excel to highlight cells with formulas.
Before you can use conditional formatting, however, you need to create a user-defined function that will return True or False, depending on whether there is a formula in a cell. The following macro will do the task very nicely:
Function HasFormula(rCell As Range) As Boolean Application.Volatile HasFormula = rCell.HasFormula End Function
To use this with conditional formatting, select the cells you want checked, and then follow these steps:
Figure 1. The New Formatting Rule dialog box.
Microsoft introduced the ISFORMULA function with Excel 2013. The ISFORMULA function allows you to highlight cells that contain formulas without using a macro. To use this function with conditional formatting, select the cells you want checked, and then follow these steps:
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9900) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Excel here: Conditionally Highlighting Cells Containing Formulas.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Conditional formatting is a great tool. You may need to use this tool to tell the difference between cells that are empty ...
Discover MoreWhen you apply conditional formatting to the cells in your worksheet, those rules can seem a bit fragile at times. For ...
Discover MoreAfter you've applied a conditional format to a cell, you may have a need to later delete that format so that the cell is ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-01-25 14:23:54
J. Woolley
You might be interested in the freely available FormulaCellsCF macro in My Excel Toolbox. Here is a simplfied version:
Public Sub FormulaCellsCF()
Const F = "=ISFORMULA(A1)+N(""FormulaCellsCF"")"
For Each FC In ActiveSheet.Cells.FormatConditions
If FC.Type = xlExpression And FC.Formula1 = F Then
FC.Delete
Done = True
End If
Next FC
If Done Then Exit Sub
With ActiveSheet.Cells.FormatConditions.Add(xlExpression, , F)
.Interior.Color = &HE6E6E6
End With
End Sub
The complete version is at https://sites.google.com/view/MyExcelToolbox/
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments