View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Unique Formulas in Excel 2002-2003

Actually the Error Checking feature can detect 8 faux pas' as Excel sees it.
The one you mentioned isn't really 'unique formula' but rather 'inconsistent
formula' which is not exactly the same thing.

Anyway to detect the errors a cell may have you can use code like this.
This code reports errors regardless of whether error checking is enabled or
what rules are selected. Also it reports all errors that apply, not just
the first.

Sub TestActiveCell()
Dim ErrDesc As String
ErrDesc = GetErrType(ActiveCell)
If ErrDesc < "" Then MsgBox GetErrType(ActiveCell)
End Sub

Function GetErrType(Rg As Range) As String
Dim Counter As Integer
Dim ErrObj As Error
Dim ErrText As String
For Counter = 1 To 8
Set ErrObj = Rg.Errors(Counter)
If ErrObj.Value Then
ErrText = ErrText & Choose(Counter, "Formula is Error", _
"2 Digit Year", "Number as Text", "Inconsistent Formula", _
"Omitted Cells", "Unlocked Formula", "Empty Ref Cell", _
"Data Validation Error") & ","
End If
Next
If ErrText < "" Then _
GetErrType = Left(ErrText, Len(ErrText) - 1)
End Function



--
Jim
"ExcelMonkey" wrote in message
...
| Excel 2002 and 2003 have a feature which identifies unique formulas in a
| range. It puts a little green tag in the top right hand corner of the
cells
| which it deems unique. What is the property for this? I am assuming that
| this is a Boolean (TRUE/FLASE).
|
| Thanks