Excel VBA - Skipping #VALUE! error

M

merlin63

I am using the following macro in a worksheet (this is a partia
macro):

j = 1
invSheet.Activate
Range("A1").Select
For i = 0 To ActiveSheet.UsedRange.Rows.Count

If ActiveCell.Offset(i, 3).Value <> 0 Then
newSheet.Range("A" & j).Value = ActiveCell.Offset(i, 0).Value
j = j + 1
End If
Next i

End Sub

There is only one problem with the macro. If it runs into any valu
that is not a number such as #VALUE! or #N/A, the macro stops. M
assumption is that I could use ISERROR somewhere in this macro t
ignore any error that can occur. How can I implement it into the macr
properly?

Thanks
 
M

merlin63

Thanks for the suggestion.

I attempted to use the "On Error Resume Next" in the beginning of m
macro and also tried placing it in several other places within m
macro. The only thing it seemed to do was actually include the valu
that I did not want.

Do you have another idea?

Thanks
 
Top