I have a macro that used to work, then I decided I want to check a range for a value, and if that value is found, replace it with 0. Now it doesn't work and I keep getting the Runtime error 13 type mismatch on that line no matter what I try. Here is the code that breaks my existing code:
Dim cell As Range
For Each cell In Range("A1:GG1000")
If cell.Value = "#N/A" Then
cell.Value = 0
End If
Next cell
I tried with if cell.value = 2 too just to see if it was a cell type issue with string/numbers, still same error at the same if line.
Any ideas?
#N/Aor would you like to check if the cell contains the error#N/A? That is a difference! - StoraxErrorforcell.value. - Storax