IFERROR(value, value_if_error)

'value - Is the argument that is checked for an error.
'value_if_error - Is the value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!

Function IFERROR(ParamArray ToEvaluate() As Variant) As Variant
    Dim vEval As Variant
    For Each vEval In ToEvaluate
        IFERROR = vEval
        If Not IsError(vEval) Then Exit Function
    Next vEval
End Function

IFERROR was added as a built-in function in 2007.

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopPrevNext