|Top Previous Next|
Searches a specified area of a worksheet for cells that that are the primary causes of error values, selecting any that are found in a multi-area range.
A primary error cell is one that results in an error value even though none of its precedents are supplying error values to it. It is an origin of error values, rather than merely propagating through the spreadsheets errors that have arisen elsewhere.
result1 = expression1.SearchForPrimaryError
Set result2 = expression2.SearchForPrimaryError(Range1)
expression1 Required. An expression that returns an IOAKAddIn object.
expression2 Required. An expression that returns an IOAKAPI object.
result1 An OAKResult enumeration indicating the success or otherwise of the action.
result2 A Range containing of all the primary error cells found within Range1, or Nothing if no such cells are found.
Range1 Required Range. The range in which to search for primary error cells.
When applied to an IOAKAddIn object, the SearchForPrimaryError method performs the same action as the OAK Development | Search | Primary error cells command. It searches for primary error cells within the current selection.
When applied to an IOAKAPI object, the SearchForPrimaryError method applies searches for primary error cells within the the range indicated by the parameter submitted to the method.
When applied to an IOAKAddIn object, the SearchForPrimaryError method follows the One-cell rule. When applied to an IOAKAPI object, it does not: if supplied a Range parameter describing a single cell, it will look in that cell only.
When applied to an IOAKAddIn object, the method will display a dialog box if no primary error cells are detected, just as the equivalent OAK user-interface command does.
If you select a small number of cells on a worksheet and then select one of the SearchForPrimaryError methods, the resulting cells might not actually be primary error cells. This is because they might refer to error cells outside your selection. It may be best to run this command on a whole worksheet.
However, you may find that even then, the cells which are found by the command do not constitute primary errors because they refer to error cells on a different worksheet in your workbook. In this case you will have to run the methods on that worksheet to find the true primary error cells.