Find and Replace #DIV/0!
Try this small macro:
Sub FixUm()
Dim er As String, equ As String, s As String
er = "#DIV/0!"
For Each r In ActiveSheet.UsedRange
If r.Text = er Then
equ = Right(r.Formula, Len(r.Formula) - 1)
equ = "(" & equ & ")"
s = "=IF(ISERROR(" & equ & ")" & ",""-""," & equ & ")"
r.Formula = s
End If
Next
End Sub
--
Gary''s Student - gsnu200841
"se7098" wrote:
I have inherited a massisve workbook to maintain and when the original
formulas were entered they were not set up to display a dash instead of the
#div/0! error...is there a way to search the entire workbook and auto replace
the formula to surround it with the =IF(ISERROR(old_formula),"",old_formula)
formula?
|