View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Metallo[_2_] Metallo[_2_] is offline
external usenet poster
 
Posts: 5
Default DIV/0 ERROR - How eliminate them in many cells contemporaneously

Hi,

Thanks Pascal.

However, if anybody as got another solution, it's very welcom.

Thank you
Alex

"Papou" wrote in message ...
Hi
Try something like this (there surely is something better) :
Sub AddErrorTrap()
Dim UsdRng, Cel As Range, OldFormula$, NewFormulaPart1$, NewFormula$
NewFormulaPart1 = "=IF(ISERROR("
Set UsdRng = ActiveSheet.UsedRange
For Each Cel In UsdRng
If Cel.HasFormula Then
OldFormula = Right(Cel.Formula, Len(Cel.Formula) - 1)
NewFormula = NewFormulaPart1 & OldFormula & "),""""," & OldFormula & ")"
Cel.Formula = NewFormula
End If
Next Cel
End Sub

HTH
Regards
Pascal


"Metallo" a écrit dans le message de news:
...
Hi,

Normally, I use the formula (EXAMPLE):
=IF(ISERROR(G12/G11*1000),"",G12/G11*1000)

In this way I prevent the error to appear.

The problem is that somebody sent me a very big Excel file with plenty
of DIV Errors, therefore I am asking how I can apply my formula to all
of them in one go.
Certainly, I cannot do this cell by cell and I am sure there is a
"batch" process I can use.

Thanks for your help

Alex