lundi 1 avril 2019

Include #N/A value in IF syntax VBA

I have a problem including in my code the #N/A value in the cell. In my sheet, I want to eliminate the cell's content is the its value is either 0 or #N/A, but i don't know to write the VBA code for the #N/A.

This is the code that works for me, but it still gives an error when it encounters the #N/A cells.

For Each value In Sheets("Comments").Range("C2:Y600")
    If value = 0 Or value = "#N/A" Then
        value = " "
    End If
Next

Aucun commentaire:

Enregistrer un commentaire