The Excel ISERROR Function
The Excel ISERROR function tests if an initial supplied expression (or value) returns an Excel Error, and if so, returns TRUE; Otherwise the function returns FALSE. The format of the ISERROR function is : ISERROR( Value )
Where the Value argument can refer to either a direct value, an Excel formula or a cell reference. ExamplesThe following spreadsheets show examples, of the Excel ISERROR function being used to determine whether a value or expression returns an error. The spreadsheet on the left shows the formulas used and the spreadsheet on the right shows the results :
In the examples above, the arguments to the ISERROR function calls are :
For more details of the different types of Excel error messages, see the page on Excel Formula Errors. The ISERROR Function In VBAThe ISERROR function is also a built-in function in VBA (used for writing Excel Macros). Within VBA, the function takes exactly the same format as when used in an Excel spreadsheet: ISERROR( Value )
For example:
After running the above 2 lines of VBA code, the variable 'A1Err' holds the value True if cell A1 of the current worksheet contains an error, and holds the value False otherwise. |
||||||||
|
|
||||||||
Copyright © 2008-2010 ExcelFunctions.net |