I am creating a macro to delete the cell values that contains # N / A, but it gives me the presents (Runtime error '13')
When I put # N / A the code works.
Can anyone help me solve the problem?
Private Sub CommandButton1_Click()
'percorre da linha 2 até a última preenchida em A
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
'se em B for #N/D
If Cells(i, 2) = "#N/D" Then
'apaga conteúdo de A
Cells(i, 2).ClearContents
End If
'próxima linha
Next i
End Sub