In Excel it’s possible to locate formulas that have references to empty cells.
For example
A1 = 1
B1 = Empty
C1 = .5
D1 = A1 + B1 + C1
D1 will correctly calculate the value to be 1.5
However, error checking will identify that there is an error in the formula D1 and it can draw an arrow to this cell.
I need to alert the user if they have a reference to an empty cell.
When I try to record myself using the feature I get this
With Application.ErrorCheckingOptions
.EvaluateToError = False
.TextDate = False
.NumberAsText = False
.InconsistentFormula = False
.OmittedCells = False
.UnlockedFormulaCells = False
.ListDataValidation = False
.InconsistentTableFormula = False
End With
ActiveSheet.ClearArrows
The options for only checking for empty cells are setup correctly but the actual execution of the “Trace” function is completely ignored. Is there any way to cause this to happen automatically and then check the result of the test?
The function is “Formulas Tab” “Error Checking” “Formulas referring to empty cells” “Trace Empty Cell”
Here is a VBA method to check Formulas referring to empty cells. This will not only tell you which formula it is but also which cell is empty.
To test this, in Sheet1, Cell A1 put this formula
Keep H1 Empty and fill F1 and G1
In Cell A5, put this formula
Keep the Cell D5 empty.
Now paste this code in a module.
When you run the macro, you will see the output in the immediate window.
SNAPSHOT