Runtime Error Handler

hey yer barred

Board Regular
Joined
Jun 19, 2007
Messages
232
Hi All

I know how to make a erorr handler, example below

Code:
On Error GoTo ErrorHandler

ErrorHandler:

If err.number = 1004 Then
       MsgBox "Test"
Else
       MsgBox "Test2"
End If

Exit Sub
End Sub

How do I make a RunTime Error handler?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi

I'm not sure what you mean by "runtime error handler" - what do you mean by this and / or in what context?

The method you illustrated catches runtime errors but is referred to as unstructured error handling:
http://msdn2.microsoft.com/en-us/library/sf1hwa21(VS.80).aspx

as opposed to structured error handling which takes the form try > catch > try etc:
http://msdn2.microsoft.com/en-us/library/8a9f2ew0(VS.80).aspx

Andrew
 
Upvote 0

Forum statistics

Threads
1,214,946
Messages
6,122,401
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top