Error message handling and resuming...

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
376
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have a macro which I need to try and debug...

I can identify the various errors, but is it possible to resume the macro if certain errors are picked up? I can then weed out which errors are the issues and tend to them applicably. This is the code I have so far:

Code:
On Error GoTo ErrorMessage

'my long macro goes here

ProcedureDone:
Exit Sub
 
ErrorMessage:


Select Case Err.number
Case 1004
[COLOR=#ff0000]    'ignore error and resume macro[/COLOR]
Case Else
' All outstanding errors
MsgBox Err.number & ": " & Error.Description
End Select


Resume ProcedureDone

If you can help me out, I 'd be very happy

Thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi, did you try just using:
Rich (BB code):
Resume Next

I think you also have a typo here, and that "Error" should just be "Err":
Rich (BB code):
MsgBox Err.Number & ": " & Error.Description
 
Upvote 0
Thank you FormR.... I didn't try that and it worked first time - gonna save alot of hassle in the future!

and I changed the Error to Err

Thanks very much for your help :)
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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