This is a sample of a part of a table that I'm working with:
This table is generated from some other VBA code. I wrote a simple script to clear the #VALUE terms from the table after it's generated.
'Clean any value errors before charting
With Worksheets("CG Raw Data")
On Error Resume Next
Range("A2:W2").End(xlDown).SpecialCells(xlCellTypeFormulas, xlErrors).ClearContents
On Error GoTo 0
End With
End Sub
Now the table looks like:
For some reason this code clears the entire column if it has any blanks and not just the #VALUE errors. I want it to just delete the #VALUE errors and keep all other cells. As far as I can tell the code should be doing that. What is the error?

=IFERROR()?IsErrorinstead. You would loop through all cells (withFor each cell in Range("A2:W2").End(xlDown) --- Next cell) and checkIf IsError(cell) Then --- End If. This should not do anything for blank cells.[Bear]completely. Are the formulas in other columns somehow dependant on the formulas that are being deleted?