Selecting cell above a #N/A

L

leshik

Hi

How can I select a cell which resides above a cell
containing a #N/A, I have tried ISERROR without success.

Thanks

leshik
 
G

Guest

The Iserror should work, but you need to then offset the
cell back one row. Try the following replacing the
Activesheet.range("C5") with whatever range you are
checking. If you are looking for the #N/A only then you
need to check for returnval = error2042 and then offset.


Dim ReturnVal, MyCheck
ReturnVal = ActiveSheet.Range("C5")
MyCheck = IsError(ReturnVal) ' Returns True.
If MyCheck = True Then

ActiveCell.Offset(-1, 0).Select

Else

End If

Best of luck

DavidC
 
Top