The below code replaces all the #Div/0! Errors to Zeros. I want the code the generate Blanks instead of Zeros. Thanks you, Shan


Sub ErrorHandlerWrapper()
Dim sht As Worksheet
Dim rngCell As Range
Dim strOldFormula As String
Dim strNewFormula As String
Dim rngErrorCells As Range

For Each sht In ActiveWorkbook.Worksheets

On Error Resume Next
Set rngErrorCells = Nothing
Set rngErrorCells = sht.UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors)

If Not rngErrorCells Is Nothing Then

On Error GoTo 0

For Each rngCell In sht.UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors).Cells

strOldFormula = Right$(rngCell.Formula, Len(rngCell.Formula) - 1)
strNewFormula = "=IF(ISERROR(" & strOldFormula & "),0," & strOldFormula & ")"

rngCell.Formula = strNewFormula

Next rngCell

End If

Next sht

End Sub