View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default How to count number of errors?

Sub test()

Dim a As Integer
Set c = Nothing
ErrorCount = 0
On Error GoTo 100
a = c

MsgBox "Number of errors were " & ErrorCount
Exit Sub

100:
ErrorCount = ErrorCount + 1
Resume Next


End Sub


"Faraz A. Qureshi" wrote:

In simple words what type of a code would be required for:
...
On Error
Counter=Counter+1;
Resume Next Or Goto 0
...

In the end:

Msgbox "Number of errors were " & Counter

--
Best Regards,

Faraz