Thread: on error goto
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gixxer_J_97[_2_] Gixxer_J_97[_2_] is offline
external usenet poster
 
Posts: 206
Default on error goto

Hi all!

i have the following code:

<BEGIN VBA CODE
On Error GoTo errorhandler1
Set loc1 =
wamer.Offset(Application.WorksheetFunction.Match(a ddCodeBox, Range(wamer,
find), 1), 0)

errorhandler1:
Set loc1 =
wamer.Offset(Application.WorksheetFunction.Match(a ddCodeBox, Range(wamer,
find), -1) - 1, 0)
Resume Next
<END VBA CODE

if i am thinking correctly, this should execute the first set loc1 and if an
error is found, then go to errorhandler1 and execute that code, then continue
with the next line after resume next - correct?

and if no error found, then it should skip errorhandler1 altogether?

if this is true - why is it not skipping the errorhandler1?
(i have tried commenting out the
on error goto, errorhandler1, the second set loc1, and resume next
and no error is found.

am i not going about this correctly?