rotpro.blogg.se

Excel formula for row color
Excel formula for row color












excel formula for row color

With this function in place, you can use the conditional formatting capabilities of Excel (detailed elsewhere in ExcelTips) to check what the formula returns. Create the following function in the VBA Editor:įunction CellHasFormula(c As Range) As Boolean If the cell does not contain a formula, then the highlight is turned off.Īnother potential solution is to use a user-defined function along with the conditional formatting capabilities of Excel. If the cell contains a formula, then it is highlighted. This macro acts on a range of cells you select before running the macro. In this case, a different macro approach is mandated. The only problem is that if a formula is deleted from a cell that was previously highlighted, the highlighting remains it is not removed automatically. You can run this macro as often as necessary in order to highlight the various cells that contain formulas. This approach can be automated, if desired, by using a macro like the following:Ī(xlCellTypeFormulas, 23).Select (See Figure 1.)Īt this point, every cell in the worksheet that contains formulas is selected, and you can add color to those cells or format them as desired. Excel displays the Go To Special dialog box.

EXCEL FORMULA FOR ROW COLOR MANUAL

If you don't have a need to do the highlighting that often, a manual approach may be best. There are several ways you can approach and solve this problem. At some time, you may wish to somehow highlight all the cells in your worksheet that contain formulas by coloring those cells. Cells in a worksheet can contain values or they can contain formulas.














Excel formula for row color