On error goto

auto

Board Regular
Joined
May 20, 2012
Messages
53
how can i make in vba that if an error is in one line of a statement then skip to the third line and resume? i tried sevrel options but i get an error
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,779
Office Version
  1. 2010
Platform
  1. Windows
Code:
Sub x()
    Dim d As Double
    
    On Error GoTo Oops
    d = 1 / 0
    d = d * 2
Line3:
    MsgBox "And here we are ..."
    Exit Sub
    
Oops:
    Resume Line3
End Sub
 

auto

Board Regular
Joined
May 20, 2012
Messages
53
ok, the problem was, that i created 4 labels the first label worked well, but all other labels didnt work, the problem is you cant set more than one "on error goto" into one precidure, so what i did is, i made in the begining the on error goto and there i repeated the steps what it should be done when there is no error,
but anyhow if some1 know from a way how we can call on error goto more then one time in one procedure, please be kind and share
 

Watch MrExcel Video

Forum statistics

Threads
1,122,335
Messages
5,595,573
Members
413,996
Latest member
mabelO

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
Top