ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting cell above a #N/A (https://www.excelbanter.com/excel-programming/302190-selecting-cell-above-n.html)

leshik

Selecting cell above a #N/A
 
Hi

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

Thanks

leshik

Bob Kilmer

Selecting cell above a #N/A
 
Application.WorksheetFunction.IsNA("A1") returns True/False

"leshik" wrote in message
...
Hi

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

Thanks

leshik




No Name

Selecting cell above a #N/A
 
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
-----Original Message-----
Hi

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

Thanks

leshik
.



All times are GMT +1. The time now is 04:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com