Excel detects if a formula is inconsistent with a calculated column in a table and shows them with a little green triangle (which says "This cell is inconsistent with the column formula"). How can I find them through VBA. I found this code that is supposed to do the trick (from http://www.ozgrid.com/forum/showthread.php?t=145306) but this only works when the used range is a normal range instead of a table:
Dim oneCell As Range
For Each oneCell In ActiveSheet.UsedRange
If oneCell.Errors(xlInconsistentFormula).Value Then
oneCell.Interior.ColorIndex = 6
Else
oneCell.Interior.ColorIndex = xlNone
End If
Next oneCell
But oneCell.Errors(xlInconsistentFormula).Value
only sends "False" so it doesn't work.
Can this be fixed to work in a table instead of a normal range?
Edit: xlInconsistentFormula doesn't do anything if you work in a table.
This works:
EDIT#1:
As Kersijus correctly points out, converting a column or set of columns into a Table suppresses the level of error-checking that raises the green flag. This code will not detect errors that are suppressed in this way.
If you have an inconsistent formula you should see something like this:
If you have none like this you might have notifications turned off (I think that's possible).