ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting cells that have InconsistentFormula error (https://www.excelbanter.com/excel-programming/357612-detecting-cells-have-inconsistentformula-error.html)

DougVba

Detecting cells that have InconsistentFormula error
 

::I am trying to detect cells that have the InconsistentFormula erro
and if possible get each cell location.

After our administrator runs a setup macro, I want to remind her t
look at any cells that have formula errors.:

--
DougVb
-----------------------------------------------------------------------
DougVba's Profile: http://www.excelforum.com/member.php...fo&userid=3300
View this thread: http://www.excelforum.com/showthread.php?threadid=52833


Richard Buttrey

Detecting cells that have InconsistentFormula error
 
On Thu, 30 Mar 2006 16:35:36 -0600, DougVba
wrote:


::I am trying to detect cells that have the InconsistentFormula error
and if possible get each cell location.

After our administrator runs a setup macro, I want to remind her to
look at any cells that have formula errors.::


In a macro

With ActiveSheet
Range(Range("A1"),
Range("A1").SpecialCells(xlCellTypeLastCell)).Spec ialCells(xlCellTypeFormulas,
16).Select

End With


Alternatively F5 (Goto), Special-- Formulas and select the Errors
checkbox, deselecting the other three.

HTH
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

DougVba[_2_]

Detecting cells that have InconsistentFormula error
 

Richard, I attached the macro to a button for testing purposes.

When I ran the macro I received a dialog box:

Run-time error: '1004':
No cells were found.

I do have a formula error on the workbook

--
DougVb
-----------------------------------------------------------------------
DougVba's Profile: http://www.excelforum.com/member.php...fo&userid=3300
View this thread: http://www.excelforum.com/showthread.php?threadid=52833


Richard Buttrey

Detecting cells that have InconsistentFormula error
 
On Thu, 30 Mar 2006 17:52:26 -0600, DougVba
wrote:


Richard, I attached the macro to a button for testing purposes.

When I ran the macro I received a dialog box:

Run-time error: '1004':
No cells were found.

I do have a formula error on the workbook.



Seems to work OK for me. Tested for #DIV/0!, #N/A, #VALUE!

What is in the cell where the error is, and what does the cell return?

Rgds
__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________

DougVba[_3_]

Detecting cells that have InconsistentFormula error
 

The cell is returning the error:
"The formula in this cell differs from the formulas in this area of th
spreadsheet."

I was trying to duplicate our timesheet spreadsheet which is returnin
an "Inconsistent Formula" error, when adjacent Sum formulas differ i
range by one cell.

It looks like the code that you gave to me should have caught th
"differs" error as well.

Here is the code that I am using. Since I have not used thi
cabability before maybe I messed up someplace:

Sub FindIFerror()
If Application.ErrorCheckingOptions.InconsistentFormu la Then

With ActiveSheet
Range(Range("A1")
Range("A1").SpecialCells(xlCellTypeLastCell)).Spec ialCells(xlCellTypeFormulas
16).Select
End With

End If
End Sub

I am also wondering what exactly the "1004" error is telling me. I wa
assuming that it did not find an "error", but perhaps the range setup i
incorrect.

Thanks for your help

--
DougVb
-----------------------------------------------------------------------
DougVba's Profile: http://www.excelforum.com/member.php...fo&userid=3300
View this thread: http://www.excelforum.com/showthread.php?threadid=52833


DougVba[_4_]

Detecting cells that have InconsistentFormula error
 

Richard, just to add a little to the mix, I modified the code abov
slightly to test your examples. "Result" is defined as a variant.

With ActiveSheet
Result = Range(Range("A1")
Range("A1").SpecialCells(xlCellTypeLastCell)).Spec ialCells(xlCellTypeFormulas
16).Select
If Result = True Then
MsgBox ("NASA, we have a problem!")
End If
End With

This works with a divide by zero error, but when I remove the divide b
zero error, I return to the run time error

--
DougVb
-----------------------------------------------------------------------
DougVba's Profile: http://www.excelforum.com/member.php...fo&userid=3300
View this thread: http://www.excelforum.com/showthread.php?threadid=52833



All times are GMT +1. The time now is 09:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com