XLA Routines: EE_ReplaceErrors

Nick's picture
Replaces the errors on a sheet
Sub EE_ReplaceErrors(Optional rng As Range, Optional ReplaceWith As String)
'http://excelexperts.com/xla-routines-eeReplaceErrors    for updates on this sub routine
' takes a range and replace the errors in the range

    Set rng = EE_TableDefault(rng)
    On Error Resume Next
    rng.SpecialCells(xlCellTypeFormulas, 16).value = ReplaceWith
    rng.SpecialCells(xlCellTypeConstants, 16).value = ReplaceWith
    Err.Clear: On Error GoTo 0: On Error GoTo -1
End Sub