Tocogroup
asked on
How do I test for a cell that contains a #N/A result from an Excel formula ?
Hi All,
I have a VLOOKUP formula in cell B6 which returns a value of #N/A. How can I test that cell (in another cell) for such an error ?
I've tried..
=IF(B6="#N/A",.........
but that doesn't work. How would I also test for this in VBA ?
Thanks in anticipation
Toco
I have a VLOOKUP formula in cell B6 which returns a value of #N/A. How can I test that cell (in another cell) for such an error ?
I've tried..
=IF(B6="#N/A",.........
but that doesn't work. How would I also test for this in VBA ?
Thanks in anticipation
Toco
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can start something like this
=IFERROR(B2,
so
This would work for any error, not just "#N/A"
=IFERROR(B2,
so
=IFERROR(B2, "ERROR FOUND")
This would work for any error, not just "#N/A"
ASKER
Thanks everyone for your quick responses.
fp, as you were first out of the blocks I'll award you the points.
Thanks again
Toco
fp, as you were first out of the blocks I'll award you the points.
Thanks again
Toco
And in VBA you can use application.worksheetfunct
There are also functions such as ISERROR or IFERROR for handling error results.