InconsistentFormula Property

Microsoft Excel Visual Basic

InconsistentFormula Property

       

When set to True (default), Microsoft Excel identifies cells containing an inconsistent formula in a region. False disables the inconsistent formula check. Read/write Boolean.

expression.InconsistentFormula

expression   Required. An expression that returns one of the objects in the Applies To list.

Remarks

Consistent formulas in the region must reside to the left and right or above and below the cell containing the inconsistent formula for the InconsistentFormula property to work properly.

Example

In the following example, when the user selects cell B4 (which contains an inconsistent formula), the AutoCorrect Options button appears. 

Sub CheckFormula()

    Application.ErrorCheckingOptions.InconsistentFormula = True

    Range("A1:A3").Value = 1
    Range("B1:B3").Value = 2
    Range("C1:C3").Value = 3

    Range("A4").Formula = "=SUM(A1:A3)"  ' Consistent formula.
    Range("B4").Formula = "=SUM(B1:B2)"  ' Inconsistent formula.
    Range("C4").Formula = "=SUM(C1:C3)"  ' Consistent formula.

End Sub