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

Metallo,
On a copy of your very big Excel file run this macro
Sub pp()
Application.Calculation = xlCalculationManual
For Each cell In ActiveSheet.UsedRange
If cell.HasFormula And _
Mid(cell.Formula, 2, 10) < "IF(ISERROR" Then
currformula = Mid(cell.Formula, 2, 255)
newformula = "=if(iserror(" & currformula & _
"),""""," & currformula & ")"
With cell
..Formula = newformula
End With
End If
Next
Application.Calculation = xlCalculationAutomatic
End Sub

HTH,
Cecil

"Metallo" wrote in message
om...
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