ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IsError() Not Working (https://www.excelbanter.com/excel-programming/280405-iserror-not-working.html)

mike

IsError() Not Working
 
In the following code the IsError function is returning False when the
cell contains #N/A. Any idea on what I'm doing wrong?

Do Until IsEmpty(ActiveCell.Offset(0, 5).Value)
If IsEmpty(ActiveCell.Value) And Not
IsEmpty(ActiveCell.Offset(0, 13).Value) Then 'if price is empty, and
Bloomberg price is not
If Not IsError(ActiveCell.Offset(0, 13).Value) Then
'fill column V only if V is empty
If IsEmpty(ActiveCell.Value) Then
ActiveCell.Value = ActiveCell.Offset(0, 13).Value
End If
End If
End If
Loop

steve

IsError() Not Working
 
Mike,
IsError(Range("A1")) worked for me whether #N/A was a text entry or
the result of a formula.

Suggest you remove the '.Value' part
If Not IsError(ActiveCell.Offset(0, 13)) Then

--
sb
"mike" wrote in message
om...
In the following code the IsError function is returning False when the
cell contains #N/A. Any idea on what I'm doing wrong?

Do Until IsEmpty(ActiveCell.Offset(0, 5).Value)
If IsEmpty(ActiveCell.Value) And Not
IsEmpty(ActiveCell.Offset(0, 13).Value) Then 'if price is empty, and
Bloomberg price is not
If Not IsError(ActiveCell.Offset(0, 13).Value) Then
'fill column V only if V is empty
If IsEmpty(ActiveCell.Value) Then
ActiveCell.Value = ActiveCell.Offset(0, 13).Value
End If
End If
End If
Loop




Tom Ogilvy

IsError() Not Working
 
It works for me. Maybe you are looking at the wrong cell.

--
Regards,
Tom Ogilvy

"mike" wrote in message
om...
In the following code the IsError function is returning False when the
cell contains #N/A. Any idea on what I'm doing wrong?

Do Until IsEmpty(ActiveCell.Offset(0, 5).Value)
If IsEmpty(ActiveCell.Value) And Not
IsEmpty(ActiveCell.Offset(0, 13).Value) Then 'if price is empty, and
Bloomberg price is not
If Not IsError(ActiveCell.Offset(0, 13).Value) Then
'fill column V only if V is empty
If IsEmpty(ActiveCell.Value) Then
ActiveCell.Value = ActiveCell.Offset(0, 13).Value
End If
End If
End If
Loop





All times are GMT +1. The time now is 11:32 PM.

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