0
我正在使用此vba
代码来删除#DIV/0!
错误。如果通过VBA发生错误
Sub IFERROR()
Dim frange As Range, c As Range, ws As Worksheet
For Each ws In Worksheets
On Error Resume Next
Set frange = ws.Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
If Not frange Is Nothing Then
For Each c In frange
c.Formula = "=IFERROR(" & Right(c.Formula, Len(c.Formula) - 1) & ","""")"
Next c
End If
Set frange = Nothing
Next ws
End Sub
上面的代码将IFERROR公式中所有的细胞,任何人可以帮我这个VBA
代码仅适用于细胞,其显示#DIV/0!
非常感谢。工作正常.............. –
在一些单元格中运行上面的代码后,我得到了这个错误#VALUE!,如何删除这个 –
可能对'c.Value = CVErr(xlErrDiv0 )或c.Value = CVErr(xlErrValue)' – Limak