View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Hans Hans is offline
external usenet poster
 
Posts: 25
Default Excel VBA - Skipping #VALUE! error

Try putting "On Error Resume Next" at the beginning of
your macro.

regards,
Hans
-----Original Message-----
I am using the following macro in a worksheet (this is a

partial
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 value
that is not a number such as #VALUE! or #N/A, the macro

stops. My
assumption is that I could use ISERROR somewhere in this

macro to
ignore any error that can occur. How can I implement it

into the macro
properly?

Thanks!


---
Message posted from http://www.ExcelForum.com/

.