This is the suggested code:
Sub ErrorToZero()
X = Right(ActiveCell.Formula,Len(ActiveCell.Formula)-1)
ActiveCell.Formula = "=IF(ISERROR(" & X & "),0," & X & ")"
End Sub
I'd use:
Option Explicit
Sub ErrorToZero2()
Dim myRng As Range
Dim myCell As Range
Dim myStr As String
Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells.SpecialCells(xlCellTypeFormulas))
On Error GoTo 0
If myRng Is Nothing Then
MsgBox "No formulas in selection!"
Exit Sub
End If
For Each myCell In myRng.Cells
myStr = Mid(myCell.Formula, 2)
myCell.Formula = "=If(iserror(" & myStr & "),0," & myStr & ")"
Next myCell
End Sub
> Hello:
>
[quoted text clipped - 6 lines]
> with little success, to make it work so I can select a section and it will
> work through the whole thing. Can anyone provide assistance?

Signature
Dave Peterson
WBTKbeezy - 21 Nov 2007 16:07 GMT
That is perfect, Dave, Thanks!
The Error Handler is a nice touch as well.
> This is the suggested code:
>
[quoted text clipped - 39 lines]
> > with little success, to make it work so I can select a section and it will
> > work through the whole thing. Can anyone provide assistance?