On Error GoTo - Issue

N00bTube

New Member
Joined
Aug 10, 2015
Messages
6
Hi!

I have a problem with my VBA code: When I use the "On Error GoTo..." and an error occurs, the VBA still stops and tells me about the error, and does not allow the code to proceed.

Here is the code:

Code:
On Error GoTo errhandler
Cells(15 + i, issuecodekol) = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 3, False)
Cells(15 + i, issuegroupcodekol).Formula = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 4, False)
Cells(15 + i, custodiankol).Formula = WorksheetFunction.VLookup(Cells(15 + i, 2).Value, Sheets("EM_S.06.02_help").Range("A1:O1000"), 5, False)
errhandler:

The code stops because the lookup-value does not exists in the lookup area, but this is something I just want it to ignore and keep on from "errhandler". I might have misunderstood something with the errhandler part - hope you can enlighten me.

Thanks,
N00bTube
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,214,821
Messages
6,121,755
Members
449,049
Latest member
excelknuckles

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