View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default on error resume next

The code where I want to use what I asked is very long, I mean, I cant paste
it here, and oviously I don't want to use the on error goto....
I was thinking in a on error resume next but the next should mean the next
of the for, no the next line, How to accomplish this???

"Jim Thomlinson" wrote:

I don't see anything in your code that should be causing an error, unless the
cells don't contain numbers and you can check for that and avoid the error.
It is good practice to use the error handler as little as possible.
--
HTH...

Jim Thomlinson


"filo666" wrote:

but, what happen if the error ocurres in other part of the macro different of
the loop?????

"tony h" wrote:


sub gtt()
on error goto AnError:
for a=1 to 10
cell(a,1)=cell(a,1)+cell(a,2)
cell(c,5)="Hola" ' if the line below is error DON'T go here
msgbox "Error en lo establecido " & cell(a,1) , vbokonly, "Error"
AnError:
next 'if error goto this next
end sub


on the basis that this is a limited loop it isn't too dangerous


--
tony h
------------------------------------------------------------------------
tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074
View this thread: http://www.excelforum.com/showthread...hreadid=505378