Handling #N/A in a cell evaluation

englishkid19

Board Regular
Joined
Nov 14, 2012
Messages
89
Hi All,
Im trying to do a simple If statment where i evalautate the content of a cell in a given column, however several cells contain #N/A and i cannot get it to evaluate the error and then place text in the cell .
My code is below ..........


If Cells(n, "BB") Is Err.Num = 2042 Then
Cells(n, "BB") = "ERROR"
Else if

Anyone got any suggestion ( 2042 ) is the number of the error im getting , anything to get the cell with #N/A in to say error would do >>
???
THanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Example:

Code:
    With Cells(n, "BB")
        If IsError(.Value) Then
            If .Value = CVErr(xlErrNA) Then
                .Value = "ERROR"
            End If
        End If
    End With
 
Upvote 0

Forum statistics

Threads
1,215,049
Messages
6,122,864
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top